summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-04-11 21:39:46 +0200
committerFlorian Pritz <f-p@gmx.at>2009-04-11 21:39:46 +0200
commit53ea962bb51e28fd35d0ecc0d8e036d8df200a44 (patch)
treec37b61ee92b4e5f877b2c070cb5e5877023758ca
parent20b5c8e1e7e8926dd89ff5817671c82ecaf0b70c (diff)
downloadbin-53ea962bb51e28fd35d0ecc0d8e036d8df200a44.tar.gz
bin-53ea962bb51e28fd35d0ecc0d8e036d8df200a44.tar.xz
small script to mute processes using oss
-rwxr-xr-xoss-mute-proc.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/oss-mute-proc.sh b/oss-mute-proc.sh
new file mode 100755
index 0000000..37ebbf2
--- /dev/null
+++ b/oss-mute-proc.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+#----------------------------------------------------
+# Version: 0.1.0
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+#
+# Copyright (C) 2008-2009 Florian Pritz
+#
+# Licensed under GNU General Public License v3
+# (see COPYING for full license text)
+#
+#----------------------------------------------------
+# script to (un)mute processes using oss
+#----------------------------------------------------
+PROC="$1"
+
+VOLUME=$(cat "$HOME/.volume_$PROC")
+if [ -z "$VOLUME" ]; then
+ VOLUME=$(ossmix | grep "\"$PROC\"" | awk '{print $4}' | awk -F : '{print $1}')
+ ossmix $PROC 0
+ echo $VOLUME > "$HOME/.volume_$PROC"
+else
+ ossmix $PROC $VOLUME
+ echo "" > "$HOME/.volume_$PROC"
+fi