added control scripts and icons to repo
authorDylan Lloyd <dylan@dylansserver.com>
Tue, 13 Mar 2012 17:27:59 +0000 (13:27 -0400)
committerDylan Lloyd <dylan@dylansserver.com>
Tue, 13 Mar 2012 17:27:59 +0000 (13:27 -0400)
12 files changed:
icons/skip-backward.png [new file with mode: 0644]
icons/skip-forward.png [new file with mode: 0644]
icons/volume-down.png [new file with mode: 0644]
icons/volume-mute.png [new file with mode: 0644]
icons/volume-on.png [new file with mode: 0644]
icons/volume-up.png [new file with mode: 0644]
scripts/back [new file with mode: 0755]
scripts/music-toggle [new file with mode: 0755]
scripts/next [new file with mode: 0755]
scripts/volume-down [new file with mode: 0755]
scripts/volume-toggle [new file with mode: 0755]
scripts/volume-up [new file with mode: 0755]

diff --git a/icons/skip-backward.png b/icons/skip-backward.png
new file mode 100644 (file)
index 0000000..d0cf74c
Binary files /dev/null and b/icons/skip-backward.png differ
diff --git a/icons/skip-forward.png b/icons/skip-forward.png
new file mode 100644 (file)
index 0000000..58c63a8
Binary files /dev/null and b/icons/skip-forward.png differ
diff --git a/icons/volume-down.png b/icons/volume-down.png
new file mode 100644 (file)
index 0000000..a4dd311
Binary files /dev/null and b/icons/volume-down.png differ
diff --git a/icons/volume-mute.png b/icons/volume-mute.png
new file mode 100644 (file)
index 0000000..ebf7c8e
Binary files /dev/null and b/icons/volume-mute.png differ
diff --git a/icons/volume-on.png b/icons/volume-on.png
new file mode 100644 (file)
index 0000000..de6b58e
Binary files /dev/null and b/icons/volume-on.png differ
diff --git a/icons/volume-up.png b/icons/volume-up.png
new file mode 100644 (file)
index 0000000..f91b061
Binary files /dev/null and b/icons/volume-up.png differ
diff --git a/scripts/back b/scripts/back
new file mode 100755 (executable)
index 0000000..fc8f08c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -n "$(pgrep pianobar)" ]
+then
+  notify-send -i /usr/share/icons/powermate/skip-backward.png "skip backward "
+  mpc next
+fi
diff --git a/scripts/music-toggle b/scripts/music-toggle
new file mode 100755 (executable)
index 0000000..0069206
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -n "$(pgrep pianobar)" ]
+then
+  pianobar-toggle
+else
+  if [ -n "$(pgrep mpd)" ]
+  then
+    mpc toggle
+  fi
+fi
diff --git a/scripts/next b/scripts/next
new file mode 100755 (executable)
index 0000000..4c7168b
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -n "$(pgrep pianobar)" ]
+then
+  notify-send -i /usr/share/icons/powermate/skip-forward.png "skipping "
+  pianobar-next
+else
+  if [ -n "$(pgrep mpd)" ]
+  then
+    notify-send -i /usr/share/icons/powermate/skip-forward.png "skipping "
+    mpc next
+  fi
+fi
diff --git a/scripts/volume-down b/scripts/volume-down
new file mode 100755 (executable)
index 0000000..256dddd
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+export DISPLAY=:0
+amixer set Master 1-
+notify-send -i /usr/share/icons/powermate/volume-down.png " "
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
diff --git a/scripts/volume-up b/scripts/volume-up
new file mode 100755 (executable)
index 0000000..a4e62c3
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+export DISPLAY=:0
+amixer set Master 1+
+notify-send -i /usr/share/icons/powermate/volume-up.png " "