Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

current rdio track

  • Loading branch information...
commit d5ae7df3cee655b2ad4794c7e8baacf72a85079d 1 parent 88013a8
@pengwynn authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 wynn/libexec/wynn-rdio
View
27 wynn/libexec/wynn-rdio
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# lifted from @sjl https://github.com/sjl/dotfiles/blob/master/bin/rdio-current-track-tmux
+
+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 $RDIO_TRACK '-' $RDIO_ARTIST
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.