Advertisement
ijontichy

mpd_status

Apr 28th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/bin/sh -
  2.  
  3. format="NP: %artist% - %track%:%title% - %album%"
  4.  
  5. mpcStLine=$(mpc --format "$format" | head -1)
  6. mpcTiLine=$(mpc --format "$format" | tail -2 | head -1)
  7. mpcTime=$(echo $mpcTiLine | grep -o "[0-9]*:[0-9]*" | head -1)
  8. mpcTot=$(echo $mpcTiLine | grep -o "[0-9]*:[0-9]*" | head -2 | tail -1)
  9.  
  10. mpcStatus="$mpcStLine [$mpcTime/$mpcTot]"
  11.  
  12. echo $mpcStatus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement