diff options
-rwxr-xr-x | oss-mute-proc.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/oss-mute-proc.sh b/oss-mute-proc.sh index 37ebbf2..bad5b6e 100755 --- a/oss-mute-proc.sh +++ b/oss-mute-proc.sh @@ -1,6 +1,6 @@ #!/bin/bash #---------------------------------------------------- -# Version: 0.1.0 +# Version: 0.1.1 # Author: Florian "Bluewind" Pritz <f-p@gmx.at> # # Copyright (C) 2008-2009 Florian Pritz @@ -12,13 +12,14 @@ # script to (un)mute processes using oss #---------------------------------------------------- PROC="$1" +VOLFILE="/tmp/${USER}_volume_${PROC}" -VOLUME=$(cat "$HOME/.volume_$PROC") +VOLUME=$(cat "$VOLFILE" 2> /dev/null) if [ -z "$VOLUME" ]; then VOLUME=$(ossmix | grep "\"$PROC\"" | awk '{print $4}' | awk -F : '{print $1}') ossmix $PROC 0 - echo $VOLUME > "$HOME/.volume_$PROC" + echo $VOLUME > "$VOLFILE" else ossmix $PROC $VOLUME - echo "" > "$HOME/.volume_$PROC" + rm "$VOLFILE" fi |