#!/bin/bash

currently-playing() {
	artist=`cmus-remote -Q | grep --text '^tag artist' | sed '/^tag artistsort/d' | awk '{gsub("tag artist ", "");print}'`
	title=`cmus-remote -Q | grep --text '^tag title' | sed -e 's/tag title //' | awk '{gsub("tag title ", "");print}'`
	echo "$artist - $title"
}

case $1 in
notify)
	notify-send "$(currently-playing)" ;;
next)
	cmus-remote -n 
	notify-send "next" ;;
prev)
	notify-send "prev"
	cmus-remote -r ;;
ppause)
	notify-send "|| >"
	cmus-remote -u ;;
*)
	;;
esac
