#!/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 2>&1 >/dev/null &
		;;
	4)
		mpc prev >/dev/null
		;;
	5)
		mpc next >/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