6 # in cmus command ":set status_display_program=cmus-status-display"
8 # This scripts is executed by cmus when status changes:
9 # cmus-status-display key1 val1 key2 val2 ...
11 # All keys contain only chars a-z. Values are UTF-8 strings.
13 # Keys: status file url artist album discnumber tracknumber title date
14 # - status (stopped, playing, paused) is always given
15 # - file or url is given only if track is 'loaded' in cmus
16 # - other keys/values are given only if they are available
21 # write status to /tmp/cmus-status (not very useful though)
22 echo "$*" >> /tmp
/cmus-status
2>&1
24 # WMI (http://wmi.modprobe.de/)
25 #wmiremote -t "$*" &> /dev/null
37 h
=$
(($_duration / 3600))
38 m
=$
(($_duration % 3600))
41 test $h -gt 0 && dur
="$h:"
42 duration
="$dur$(printf '%02d:%02d' $(($m / 60)) $(($m % 60)))"
44 output
"[$_status] $_artist - $_album - $_title ($_date) $duration"
47 output
"[$_status] $_url - $_title"