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

@ -2,6 +2,7 @@ pragma Singleton
import qs.config
import qs.custom
import QtQuick
import Quickshell
import Quickshell.Services.Pipewire
@ -37,15 +38,49 @@ Singleton {
}
CustomShortcut {
id: volumeUp
name: "volumeUp"
description: "Increase volume"
onPressed: root.increaseVolume()
onPressed: {
root.increaseVolume();
volumeUpTimer.interval = 800;
volumeUpTimer.running = true;
}
onReleased: {
volumeUpTimer.running = false;
}
}
Timer {
id: volumeUpTimer
interval: 800
repeat: true
onTriggered: {
interval = 200;
root.increaseVolume();
}
}
CustomShortcut {
id: volumeDown
name: "volumeDown"
description: "Decrease volume"
onPressed: root.decreaseVolume()
onPressed: {
root.decreaseVolume();
volumeDownTimer.interval = 800;
volumeDownTimer.running = true;
}
onReleased: {
volumeDownTimer.running = false;
}
}
Timer {
id: volumeDownTimer
interval: 800
repeat: true
onTriggered: {
interval = 200;
root.decreaseVolume();
}
}
CustomShortcut {