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

keybinds: initial support for writable hyprland and mangoWC

fixes #1204
This commit is contained in:
bbedward
2026-01-07 12:15:38 -05:00
parent e822fa73da
commit a205df1bd6
16 changed files with 2372 additions and 287 deletions

View File

@@ -136,12 +136,12 @@ Item {
}
}
function _ensureNiriProvider() {
function _ensureCurrentProvider() {
if (!KeybindsService.available)
return;
const cachedProvider = KeybindsService.keybinds?.provider;
if (cachedProvider !== "niri" || KeybindsService._dataVersion === 0) {
KeybindsService.currentProvider = "niri";
const targetProvider = KeybindsService.currentProvider;
if (cachedProvider !== targetProvider || KeybindsService._dataVersion === 0) {
KeybindsService.loadBinds();
return;
}
@@ -152,13 +152,13 @@ Item {
}
}
Component.onCompleted: _ensureNiriProvider()
Component.onCompleted: _ensureCurrentProvider()
onVisibleChanged: {
if (!visible)
return;
Qt.callLater(scrollToTop);
_ensureNiriProvider();
_ensureCurrentProvider();
}
DankFlickable {
@@ -213,7 +213,8 @@ Item {
}
StyledText {
text: I18n.tr("Click any shortcut to edit. Changes save to dms/binds.kdl")
readonly property string bindsFile: KeybindsService.currentProvider === "niri" ? "dms/binds.kdl" : "dms/binds.conf"
text: I18n.tr("Click any shortcut to edit. Changes save to %1").arg(bindsFile)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
@@ -310,11 +311,12 @@ Item {
}
StyledText {
readonly property string bindsFile: KeybindsService.currentProvider === "niri" ? "dms/binds.kdl" : "dms/binds.conf"
text: {
if (warningBox.showSetup)
return I18n.tr("Click 'Setup' to create dms/binds.kdl and add include to config.kdl.");
return I18n.tr("Click 'Setup' to create %1 and add include to config.").arg(bindsFile);
if (warningBox.showError)
return I18n.tr("dms/binds.kdl exists but is not included in config.kdl. Custom keybinds will not work until this is fixed.");
return I18n.tr("%1 exists but is not included in config. Custom keybinds will not work until this is fixed.").arg(bindsFile);
if (warningBox.showWarning) {
const count = warningBox.status.overriddenBy;
return I18n.tr("%1 DMS bind(s) may be overridden by config binds that come after the include.").arg(count);