Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chancellorr

macrumors newbie
Original poster
Oct 26, 2013
1
0
Is there anyway to do this? I'm trying to find a way to display my CMUS now playing info and I feel like this would be the easiest way if its even possible. Someone please help. :]
 

hyw1993

macrumors newbie
Mar 10, 2014
1
0
Seattle
Is there anyway to do this? I'm trying to find a way to display my CMUS now playing info and I feel like this would be the easiest way if its even possible. Someone please help. :]

Try this (change CMUSREMOTEPATH if it is not there):

#!/bin/bash

CMUSREMOTEPATH='/usr/local/bin/cmus-remote' # path of cmus-remote

status=`$CMUSREMOTEPATH -Q 2> /dev/null`

if [ $? -eq 1 ] || ! echo "$status" | grep 'status playing' > /dev/null; then
exit
fi

echo -n 'Now Playing: '
echo -n `echo "$status" | egrep 'tag title (.*)' | sed -E 's/tag title (.*)/\1/g'`
echo -n ' - '
echo -n `echo "$status" | egrep 'tag artist (.*)' | sed -E 's/tag artist (.*)/\1/g'`
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.