From 0bb1e90c8b2461040449d81aa114f29f6621ef7c Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Wed, 7 Dec 2022 13:57:09 -0500 Subject: Mute audio on screen lock --- ext/lock.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ext/lock.sh') diff --git a/ext/lock.sh b/ext/lock.sh index d3ca4c4..d8677f2 100755 --- a/ext/lock.sh +++ b/ext/lock.sh @@ -11,17 +11,18 @@ convert /tmp/.lockscreen.png \ convert -composite -gravity center /tmp/.lockscreen.png "$HOME/.dots/ext/lock-overlay.png" /tmp/.lockscreen.png -# Turn on DND -#old_dnd="$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)" -#xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true - # Pause stuff and mute audio +_muted="$(pacmd list-sinks | awk '/muted/ { print $2 }')" +[[ "$_muted" == "no" ]] && pactl set-sink-mute @DEFAULT_SINK@ 1 #playerctl -a pause > /dev/null -#old_mute="$(amixer get Master | tail -2 | grep '\[on\]')" #amixer set Master mute > /dev/null +# Turn on DND +#old_dnd="$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)" +#xfconf-query -c xfce4-notifyd -p /do-not-disturb -s true + i3lock --nofork --ignore-empty-password --show-failed-attempts --image /tmp/.lockscreen.png & # Set settings back to what they were before -#test -z "$old_mute" || amixer set Master unmute > /dev/null #test "$old_dnd" = false && xfconf-query -c xfce4-notifyd -p /do-not-disturb -s false +[[ "$_muted" == "no" ]] && pactl set-sink-mute @DEFAULT_SINK@ 0 -- cgit v1.2.3