added control scripts and icons to repo
[powermate.git] / scripts / volume-toggle
diff --git a/scripts/volume-toggle b/scripts/volume-toggle
new file mode 100755 (executable)
index 0000000..407bf01
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export DISPLAY=:0
+status=$(amixer get Master | tail -n1 | awk '{print $NF}')
+status=$(echo "${status%]}")
+status=$(echo "${status#[}")
+if [ $status == "on" ]
+  then notify-send -i /usr/share/icons/powermate/volume-on.png " "
+elif [ $status == "off" ]
+  then notify-send -i /usr/share/icons/powermate/volume-mute.png " "
+fi
+amixer set Master toggle