fix: manually implement repeating keybinds

Apparently Hyprland's repeating keybinds don't work properly with DBus
shortcuts, so we have to implement this logic ourselves.
This commit is contained in:
Kiana Sheibani 2025-10-08 00:00:12 -04:00
parent 8f085b5c36
commit b81b90ed7b
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 75 additions and 4 deletions

View file

@ -1,6 +1,7 @@
pragma Singleton
pragma ComponentBehavior: Bound
import qs.config
import qs.custom
import Quickshell
import Quickshell.Io
@ -67,15 +68,50 @@ Singleton {
}
CustomShortcut {
id: brightnessUp
name: "brightnessUp"
description: "Increase brightness"
onPressed: root.increaseBrightness()
onPressed: {
console.log("a")
root.increaseBrightness();
brightnessUpTimer.interval = 800;
brightnessUpTimer.running = true;
}
onReleased: {
brightnessUpTimer.running = false;
}
}
Timer {
id: brightnessUpTimer
interval: 800
repeat: true
onTriggered: {
interval = 200;
root.increaseBrightness();
}
}
CustomShortcut {
id: brightnessDown
name: "brightnessDown"
description: "Decrease brightness"
onPressed: root.decreaseBrightness()
onPressed: {
root.decreaseBrightness();
brightnessDownTimer.interval = 800;
brightnessDownTimer.running = true;
}
onReleased: {
brightnessDownTimer.running = false;
}
}
Timer {
id: brightnessDownTimer
interval: 800
repeat: true
onTriggered: {
interval = 200;
root.decreaseBrightness();
}
}
component Monitor: QtObject {