Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: a4a8fa26a9
Fetching contributors…

Cannot retrieve contributors at this time

executable file 44 lines (37 sloc) 0.907 kB
#!/bin/sh
##
# cmus-notify -- based on cmus-status-display
# author: nblock <nblock [at] archlinux [dot] us>
# version: git
# license: GPLv2
##
# a simple script to display cmus' status inside awesome with awesome-client
#
# in cmus: ":set status_display_program=/path/to/cmus-notify" to activate the script
##
output()
{
echo "$*" |awesome-client 2>&1
}
while test $# -ge 2
do
eval _$1='$2'
shift
shift
done
START="cmus.text=\"<span foreground='orange'>music: </span><span foreground='green'>"
END='</span>"'
if test -n "$_file"
then
h=$(($_duration / 3600))
m=$(($_duration % 3600))
duration=""
test $h -gt 0 && dur="$h:"
duration="$dur$(printf '%02d:%02d' $(($m / 60)) $(($m % 60)))"
output "${START}[$_status] $_artist - $_title - $_album ($_date) [$duration]${END}"
elif test -n "$_url"
then
output "${START}[$_status] $_url - $_title${END}"
else
output "${START}[$_status]${END}"
fi
Jump to Line
Something went wrong with that request. Please try again.