diff --git a/services/Audio.qml b/services/Audio.qml index 2c38010..75fd528 100644 --- a/services/Audio.qml +++ b/services/Audio.qml @@ -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 { diff --git a/services/Brightness.qml b/services/Brightness.qml index b369d2f..34403d0 100644 --- a/services/Brightness.qml +++ b/services/Brightness.qml @@ -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 {