forked from Shinonome/dots-hyprland
volume osd: only show on focused screen
This commit is contained in:
@@ -12,6 +12,7 @@ import Quickshell.Hyprland
|
||||
Scope {
|
||||
id: root
|
||||
property bool showOsdValues: false
|
||||
property ShellScreen focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name)
|
||||
|
||||
function triggerOsd() {
|
||||
showOsdValues = true
|
||||
@@ -47,23 +48,26 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
Loader {
|
||||
id: osdLoader
|
||||
property var modelData
|
||||
active: showOsdValues
|
||||
|
||||
PanelWindow {
|
||||
screen: modelData
|
||||
id: osdRoot
|
||||
|
||||
Connections {
|
||||
target: root
|
||||
function onFocusedScreenChanged() {
|
||||
osdRoot.screen = root.focusedScreen
|
||||
}
|
||||
}
|
||||
|
||||
exclusionMode: ExclusionMode.Normal
|
||||
WlrLayershell.namespace: "quickshell:onScreenDisplay"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
color: "transparent"
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
}
|
||||
anchors.top: true
|
||||
mask: Region {
|
||||
item: osdValuesWrapper
|
||||
}
|
||||
@@ -111,8 +115,6 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "osdVolume"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user