aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/mpd
diff options
context:
space:
mode:
Diffstat (limited to 'config/i3blocks/scripts/mpd')
-rwxr-xr-xconfig/i3blocks/scripts/mpd67
1 files changed, 0 insertions, 67 deletions
diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd
deleted file mode 100755
index 914def6..0000000
--- a/config/i3blocks/scripts/mpd
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-HOST_HOME="10.8.2.51"
-
-HOST=""
-# Let's be sneaky and verify that we are on relevant network before we try to ping
-if ip a | grep -q 'inet 10.8.2.' && \
- ping -c 1 -w 1 "$HOST_HOME" >/dev/null 2>&1; then
- # TODO check that mpd is running?
- HOST="-h $HOST_HOME"
-fi
-
-STATUS="$(mpc $HOST status)"
-
-# Handle remote volume
-if [ "$BLOCK_INSTANCE" = "remote" ]; then
- [ -n "$HOST" ] || exit 0
- case "$BLOCK_BUTTON" in
- 1)
- mpc $HOST volume 40 >/dev/null
- ;;
- 3)
- mpc $HOST volume 0 >/dev/null
- ;;
- 4)
- mpc $HOST volume +2 >/dev/null
- ;;
- 5)
- mpc $HOST volume -2 >/dev/null
- ;;
- esac
-
- if echo "$STATUS" | grep -qE "(playing|paused)"; then
- echo "♫ $(mpc $HOST volume | sed 's/volume: //')"
- fi
- exit 0
-fi
-
-# Handle user input
-case "$BLOCK_BUTTON" in
- 1)
- mpc $HOST toggle >/dev/null
- ;;
- 2)
- mpc $HOST stop >/dev/null
- ;;
- 3)
- nohup urxvt -title "Music player daemon client" -e ncmpcpp $HOST 2>&1 >/dev/null &
- ;;
- 4)
- mpc $HOST prev >/dev/null
- ;;
- 5)
- mpc $HOST next >/dev/null
- ;;
-esac
-
-if echo "$STATUS" | grep -qE "(playing|paused)"; then
- echo `mpc $HOST -f "♫ %artist%, %album%, %title%" status | head -1`
- echo
- if echo "$STATUS" | grep -q playing; then
- echo "#00ff00"
- elif echo "$STATUS" | grep -q paused; then
- echo "#ffff00"
- fi
-else
- echo "♫"
-fi