From 14a94a4ece23ed79f9277d6be2a4beba180907cd Mon Sep 17 00:00:00 2001 From: Jeena Date: Sat, 11 Apr 2026 06:54:59 +0000 Subject: [PATCH] feat: auto-mute audio on lock and unmute on unlock --- hypr/hypridle.conf | 3 ++- hypr/scripts/lock.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hypr/hypridle.conf b/hypr/hypridle.conf index 49aa6de..25718c3 100644 --- a/hypr/hypridle.conf +++ b/hypr/hypridle.conf @@ -24,6 +24,7 @@ listener { listener { timeout = 120 on-timeout = ~/.config/hypr/scripts/lock.sh + on-resume = wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 } # Step 3: Turn screen off at 5 min idle @@ -38,7 +39,7 @@ listener { # Both together ensure the screen is fully off visually and electrically # When the user becomes active again, restore display - on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100 + on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100 && wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 # Explanation: # - hyprctl dispatch dpms on → ensures the display is powered on by the compositor diff --git a/hypr/scripts/lock.sh b/hypr/scripts/lock.sh index 1664500..aa87fd8 100755 --- a/hypr/scripts/lock.sh +++ b/hypr/scripts/lock.sh @@ -1,3 +1,4 @@ #!/bin/bash hyprctl switchxkblayout all 0 -loginctl lock-session +wpctl set-mute @DEFAULT_AUDIO_SINK@ 1 +hyprlock && wpctl set-mute @DEFAULT_AUDIO_SINK@ 0