From 01f86316639631c933c344bb9ea40a22eaff3ccd Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:03:18 +0200 Subject: [PATCH] disallow volume over 200% --- .config/quickshell/ii/services/Audio.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/services/Audio.qml b/.config/quickshell/ii/services/Audio.qml index 0651ebc70..f0c471910 100644 --- a/.config/quickshell/ii/services/Audio.qml +++ b/.config/quickshell/ii/services/Audio.qml @@ -14,6 +14,7 @@ Singleton { property bool ready: Pipewire.defaultAudioSink?.ready ?? false property PwNode sink: Pipewire.defaultAudioSink property PwNode source: Pipewire.defaultAudioSource + readonly property real hardMaxValue: 2.00 // People keep joking about setting volume to 5172% so... signal sinkProtectionTriggered(string reason); @@ -39,7 +40,7 @@ Singleton { if (newVolume - lastVolume > maxAllowedIncrease) { sink.audio.volume = lastVolume; root.sinkProtectionTriggered("Illegal increment"); - } else if (newVolume > maxAllowed) { + } else if (newVolume > maxAllowed || newVolume > root.hardMaxValue) { root.sinkProtectionTriggered("Exceeded max allowed"); sink.audio.volume = Math.min(lastVolume, maxAllowed); }