mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
keyboard/hyprland: sync keyboard layout with event
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
@@ -78,6 +79,16 @@ BasePill {
|
||||
root.hyprlandKeyboard,
|
||||
"next"
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: CompositorService.isHyprland ? Hyprland : null
|
||||
enabled: CompositorService.isHyprland
|
||||
|
||||
function onRawEvent(event) {
|
||||
if (event.name === "activelayout") {
|
||||
updateLayout()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,13 +253,19 @@ Singleton {
|
||||
mediaDevices = Qt.createQmlObject(`
|
||||
import QtQuick
|
||||
import QtMultimedia
|
||||
MediaDevices {}
|
||||
MediaDevices {
|
||||
id: devices
|
||||
Component.onCompleted: {
|
||||
console.log("AudioService: MediaDevices initialized, default output:", defaultAudioOutput?.description)
|
||||
}
|
||||
}
|
||||
`, root, "AudioService.MediaDevices")
|
||||
|
||||
if (mediaDevices) {
|
||||
mediaDevicesConnections = Qt.createQmlObject(`
|
||||
import QtQuick
|
||||
Connections {
|
||||
target: root.mediaDevices
|
||||
function onDefaultAudioOutputChanged() {
|
||||
console.log("AudioService: Default audio output changed, recreating sound players")
|
||||
root.destroySoundPlayers()
|
||||
@@ -267,7 +273,6 @@ Singleton {
|
||||
}
|
||||
}
|
||||
`, root, "AudioService.MediaDevicesConnections")
|
||||
mediaDevicesConnections.target = mediaDevices
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("AudioService: MediaDevices not available, using default audio output")
|
||||
|
||||
Reference in New Issue
Block a user