1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

keybinds/cheasheet: support all providers

This commit is contained in:
bbedward
2025-11-09 16:26:15 -05:00
parent 47c5320d67
commit bba21408ea
6 changed files with 343 additions and 350 deletions

View File

@@ -306,11 +306,58 @@ Item {
target: "mpris"
}
IpcHandler {
function toggle(provider: string): string {
if (!provider) {
return "ERROR: No provider specified"
}
KeybindsService.loadProvider(provider)
root.hyprKeybindsModalLoader.active = true
if (root.hyprKeybindsModalLoader.item) {
if (root.hyprKeybindsModalLoader.item.shouldBeVisible) {
root.hyprKeybindsModalLoader.item.close()
} else {
root.hyprKeybindsModalLoader.item.open()
}
return `KEYBINDS_TOGGLE_SUCCESS: ${provider}`
}
return `KEYBINDS_TOGGLE_FAILED: ${provider}`
}
function open(provider: string): string {
if (!provider) {
return "ERROR: No provider specified"
}
KeybindsService.loadProvider(provider)
root.hyprKeybindsModalLoader.active = true
if (root.hyprKeybindsModalLoader.item) {
root.hyprKeybindsModalLoader.item.open()
return `KEYBINDS_OPEN_SUCCESS: ${provider}`
}
return `KEYBINDS_OPEN_FAILED: ${provider}`
}
function close(): string {
if (root.hyprKeybindsModalLoader.item) {
root.hyprKeybindsModalLoader.item.close()
return "KEYBINDS_CLOSE_SUCCESS"
}
return "KEYBINDS_CLOSE_FAILED"
}
target: "keybinds"
}
IpcHandler {
function openBinds(): string {
if (!CompositorService.isHyprland) {
return "HYPR_NOT_AVAILABLE"
}
KeybindsService.loadProvider("hyprland")
root.hyprKeybindsModalLoader.active = true
if (root.hyprKeybindsModalLoader.item) {
root.hyprKeybindsModalLoader.item.open()
@@ -334,6 +381,7 @@ Item {
if (!CompositorService.isHyprland) {
return "HYPR_NOT_AVAILABLE"
}
KeybindsService.loadProvider("hyprland")
root.hyprKeybindsModalLoader.active = true
if (root.hyprKeybindsModalLoader.item) {
if (root.hyprKeybindsModalLoader.item.shouldBeVisible) {