sb

shitty bar for dwm
git clone git://git.ckyln.com/~cem/sb.git
Log | Files | Refs | README | LICENSE

sb_showmpd (301B)


      1 # gets song info from mpd
      2 
      3 showmpd() {
      4     out=$(mpc -f "[[%artist% - ]%title%]|[%file%]" 2>/dev/null | tr '\n' ' ')
      5     time="${out#*] */* }" time="${time## }" time=${time%% (*}
      6     out=${out%% \[*}
      7 
      8     [ "$out" = "$time" ] && return 0
      9 
     10     printf 'Playing: %s %s %s ' "$out" "$time" "$DELIMETER"
     11 }