bin/rdio-current-track-tmux @ 51427e0e3e0d
Update subrepository state.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 15 May 2012 11:16:33 -0400 |
parents |
46338ddc962a |
children |
(none) |
#!/usr/bin/env bash
RDIO_TRACK=$(osascript <<EOF
if appIsRunning("Rdio") then
tell app "Rdio" to get the name of the current track
end if
on appIsRunning(appName)
tell app "System Events" to (name of processes) contains appName
end appIsRunning
EOF)
if test "x$RDIO_TRACK" != "x"; then
RDIO_ARTIST=$(osascript <<EOF
if appIsRunning("Rdio") then
tell app "Rdio" to get the artist of the current track
end if
on appIsRunning(appName)
tell app "System Events" to (name of processes) contains appName
end appIsRunning
EOF)
echo '#[fg=colour137,bg=colour234]⮂#[bg=colour137,fg=colour16,bold] ♫' $RDIO_TRACK '#[nobold]-#[bold]' $RDIO_ARTIST '#[fg=colour254,bg=colour137,nobold]'
fi