From 224cbdcdd21784510a7132ab188db16982d761a2 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Thu, 27 May 2021 09:15:43 +0100 Subject: [PATCH] Update mutelock.sh --- .gitconfig | 4 ++++ bin/mutelock.sh | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitconfig b/.gitconfig index 7b4c51e..4e6f667 100644 --- a/.gitconfig +++ b/.gitconfig @@ -2,6 +2,10 @@ name = Scott Wallace email = scott@wallace.sh signingkey = AA742FDC5AFE2A72 +[includeIf "gitdir:~/src/work/suborbit/**"] + path = ~/src/work/suborbit/.gitconfig +[includeIf "gitdir:~/src/work/suborbit/optimal/**"] + path = ~/src/work/suborbit/optimal/.gitconfig [push] default = simple [pack] diff --git a/bin/mutelock.sh b/bin/mutelock.sh index 52a18d6..4a0cb3f 100755 --- a/bin/mutelock.sh +++ b/bin/mutelock.sh @@ -4,16 +4,18 @@ #https://unix.stackexchange.com/users/231160/nik-gnomic # Post on stackexchange: https://unix.stackexchange.com/questions/467456/how-to-mute-sound-when-xscreensaver-locks-screen/589614#589614 -gdbus monitor -e -d org.xfce.ScreenSaver | grep ActiveChanged --line-buffered | - while read line - do - case "$line" in - *"(true,)"*) - pactl set-sink-mute @DEFAULT_SINK@ on - ;; - *"(false,)"*) - pactl set-sink-mute @DEFAULT_SINK@ off - ;; - esac - done +# Do nothing for a bit to ensure gdbus is up and awake, etc. +sleep 300 + +gdbus monitor -e -d org.xfce.ScreenSaver | grep -h ActiveChanged --line-buffered | + while read LINE; do + case "${LINE}" in + *"(true,)"*) + pactl set-sink-mute @DEFAULT_SINK@ on + ;; + *"(false,)"*) + pactl set-sink-mute @DEFAULT_SINK@ off + ;; + esac + done exit