From 1d257034ef7da805280cc70326738cc86e8512bb Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 23 Dec 2016 18:40:22 -0600 Subject: desktop: simplify mute script --- desktop/bin/aumute | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'desktop') diff --git a/desktop/bin/aumute b/desktop/bin/aumute index dd956d2..0bef6a3 100755 --- a/desktop/bin/aumute +++ b/desktop/bin/aumute @@ -31,29 +31,24 @@ # aumix-toggle-mute.sh --force-unmute # -TMP=$$ +MUTERC="$HOME/.aumixrc.mute" function __mute() { - if [ -e "$HOME/.aumixrc.mute" ]; then + if [ -e "$MUTERC" ]; then aumix -v 0; aumix -w 0 else - mv -f $HOME/.aumixrc $HOME/.aumixrc.$TMP - aumix -S + aumix -f "$MUTERC" -S aumix -v 0; aumix -w 0 - mv -f $HOME/.aumixrc $HOME/.aumixrc.mute - mv -f $HOME/.aumixrc.$TMP $HOME/.aumixrc fi } function __unmute () { - if [ -e "$HOME/.aumixrc.mute" ]; then - mv -f $HOME/.aumixrc $HOME/.aumixrc.$TMP - mv -f $HOME/.aumixrc.mute $HOME/.aumixrc - aumix -L > /dev/null - mv -f $HOME/.aumixrc.$TMP $HOME/.aumixrc + if [ -e "$MUTERC" ]; then + aumix -f "$MUTERC" -L > /dev/null + rm -f "$MUTERC" else aumix -L > /dev/null fi @@ -68,7 +63,7 @@ elif [ "$1" = "--force-unmute" ]; then __unmute; -elif [ -e "$HOME/.aumixrc.mute" ]; then +elif [ -e "$MUTERC" ]; then __unmute; -- cgit v1.2.3