1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

dwl/mango: support keyboard layout

This commit is contained in:
bbedward
2025-11-16 14:24:56 -05:00
parent 6f359df8f9
commit 2e6dbedb8b
7 changed files with 434 additions and 7 deletions

View File

@@ -13,7 +13,14 @@ BasePill {
id: root
property bool compactMode: SettingsData.keyboardLayoutNameCompactMode
property string currentLayout: CompositorService.isNiri ? NiriService.getCurrentKeyboardLayoutName() : ""
property string currentLayout: {
if (CompositorService.isNiri) {
return NiriService.getCurrentKeyboardLayoutName()
} else if (CompositorService.isDwl) {
return DwlService.currentKeyboardLayout
}
return ""
}
property string hyprlandKeyboard: ""
content: Component {
@@ -79,6 +86,8 @@ BasePill {
root.hyprlandKeyboard,
"next"
])
} else if (CompositorService.isDwl) {
Quickshell.execDetached(["mmsg", "-d", "switch_keyboard_layout"])
}
}
}

View File

@@ -14,6 +14,11 @@ Singleton {
property var layouts: []
property string activeOutput: ""
property var outputScales: ({})
property string currentKeyboardLayout: {
if (!outputs || !activeOutput) return ""
const output = outputs[activeOutput]
return (output && output.kbLayout) || ""
}
signal stateChanged()