aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/mpd
blob: 0b915a66f1f8545a2b64e87f2253d41efaddab15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

case "$BLOCK_BUTTON" in
	1)
		mpc toggle >/dev/null
		;;
	2)
		mpc stop >/dev/null
		;;
	3)
		nohup urxvt -title "Music player daemon client" -e ncmpcpp &
		;;
	4)
		mpc next >/dev/null
		;;
	5)
		mpc prev >/dev/null
		;;
esac

if [ -n "`mpc status | grep -E "(playing|paused)"`" ]; then
	echo `mpc -f "♫ %artist%, %album%, %title%" status | head -1`
	echo
	if [ -n `mpc status | grep playing` ]; then
		echo "#ffff00"
	elif [ -n `mpc status | grep paused` ]; then
		echo "#00ff00"
	fi
else
	echo "♫"
fi