Advertisement
Guest User

cmus-conky.sh

a guest
May 19th, 2015
723
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. ## Script to push 'now playing' from cmus to conky. Fixed to stop the Album Artist and other things being displayed by accident.
  3. ## Updated to be more foolproof.
  4.  
  5. if [ ! -x /usr/bin/cmus-remote ]; then
  6.     echo "cmus is not installed."
  7.     exit
  8. fi
  9.  
  10. # The below lines now search specifically for "tag foo".
  11. ARTIST=$( cmus-remote -Q 2>/dev/null | grep "tag artist" | cut -d " " -f 3- )
  12. TITLE=$( cmus-remote -Q 2>/dev/null | grep "tag title" | cut -d " " -f 3- )
  13.  
  14. if [ -z "$ARTIST" ]; then
  15.     echo "Nothing"
  16. else
  17.     echo "$ARTIST - $TITLE"
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement