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

keybinds: add toggleWithPath

This commit is contained in:
bbedward
2025-11-14 09:03:27 -05:00
parent 0d7c2e1024
commit 67c642de4c
2 changed files with 51 additions and 1 deletions

View File

@@ -326,6 +326,25 @@ Item {
return `KEYBINDS_TOGGLE_FAILED: ${provider}`
}
function toggleWithPath(provider: string, path: string): string {
if (!provider) {
return "ERROR: No provider specified"
}
KeybindsService.loadProviderWithPath(provider, path)
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} (${path})`
}
return `KEYBINDS_TOGGLE_FAILED: ${provider}`
}
function open(provider: string): string {
if (!provider) {
return "ERROR: No provider specified"
@@ -341,6 +360,21 @@ Item {
return `KEYBINDS_OPEN_FAILED: ${provider}`
}
function openWithPath(provider: string, path: string): string {
if (!provider) {
return "ERROR: No provider specified"
}
KeybindsService.loadProviderWithPath(provider, path)
root.hyprKeybindsModalLoader.active = true
if (root.hyprKeybindsModalLoader.item) {
root.hyprKeybindsModalLoader.item.open()
return `KEYBINDS_OPEN_SUCCESS: ${provider} (${path})`
}
return `KEYBINDS_OPEN_FAILED: ${provider}`
}
function close(): string {
if (root.hyprKeybindsModalLoader.item) {
root.hyprKeybindsModalLoader.item.close()