Skip to content

Commit e1cdf4e

Browse files
committed
keyboard/hyprland: sync keyboard layout with event
1 parent e4371ea commit e1cdf4e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Modules/DankBar/Widgets/KeyboardLayoutName.qml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import QtQuick
22
import QtQuick.Controls
33
import Quickshell
4+
import Quickshell.Hyprland
45
import Quickshell.Io
56
import qs.Common
67
import qs.Modules.Plugins
@@ -78,6 +79,16 @@ BasePill {
7879
root.hyprlandKeyboard,
7980
"next"
8081
])
82+
}
83+
}
84+
}
85+
86+
Connections {
87+
target: CompositorService.isHyprland ? Hyprland : null
88+
enabled: CompositorService.isHyprland
89+
90+
function onRawEvent(event) {
91+
if (event.name === "activelayout") {
8192
updateLayout()
8293
}
8394
}

Services/AudioService.qml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,26 @@ Singleton {
253253
mediaDevices = Qt.createQmlObject(`
254254
import QtQuick
255255
import QtMultimedia
256-
MediaDevices {}
256+
MediaDevices {
257+
id: devices
258+
Component.onCompleted: {
259+
console.log("AudioService: MediaDevices initialized, default output:", defaultAudioOutput?.description)
260+
}
261+
}
257262
`, root, "AudioService.MediaDevices")
258263

259264
if (mediaDevices) {
260265
mediaDevicesConnections = Qt.createQmlObject(`
261266
import QtQuick
262267
Connections {
268+
target: root.mediaDevices
263269
function onDefaultAudioOutputChanged() {
264270
console.log("AudioService: Default audio output changed, recreating sound players")
265271
root.destroySoundPlayers()
266272
root.createSoundPlayers()
267273
}
268274
}
269275
`, root, "AudioService.MediaDevicesConnections")
270-
mediaDevicesConnections.target = mediaDevices
271276
}
272277
} catch (e) {
273278
console.log("AudioService: MediaDevices not available, using default audio output")

0 commit comments

Comments
 (0)