feat: auto-mute audio on lock and unmute on unlock

This commit is contained in:
Jeena 2026-04-11 06:54:59 +00:00
parent 6bab9ea200
commit 14a94a4ece
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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