Browse files

Added Rdio track to tmux status

  • Loading branch information...
1 parent 5706566 commit a687e53479f8b42c7ba98b5cae1d78e0895fc66d @pengwynn committed Jul 4, 2012
Showing with 31 additions and 3 deletions.
  1. +27 −0 bin/rdio-current-track-tmux
  2. +4 −3 tmux/tmux.conf.symlink
View
27 bin/rdio-current-track-tmux
@@ -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 '#[fg=colour4] ♫' $RDIO_TRACK '#[fg=default]'
+fi
View
7 tmux/tmux.conf.symlink
@@ -65,15 +65,14 @@ set-option -g status-bg default
# Where appropriate, special character sequences may be prefixed with a
# number to specify the maximum length, in this line "#10W'.
set-option -g status-left ''
-set-option -g status-right '#[fg=yellow]#S#[fg=default] // %Y-%m-%d %H:%M'
+set-option -g status-right '#[fg=yellow]#S#[fg=default] //#(rdio-current-track-tmux)//#[fg=default]%e %b %H:%M'
set-option -g status-right-length 100
set-option -g status-left-length 120
## highlight active window
set-window-option -g window-status-current-fg colour4
set-window-option -g window-status-current-bg default
-set-window-option -g window-status-current-attr bright
set-window-option -g window-status-current-format '[ #I #W ]'
## set window notifications
@@ -96,8 +95,10 @@ set-window-option -g allow-rename off
## tmux window titling for X
set-option -g set-titles on
set-option -g set-titles-string '#S'
+
set-window-option -g window-status-format ' #I #W '
-set-window-option -g window-status-attr bold
+set-window-option -g window-status-attr dim
+
# starts windows at 1 not 0
set-option -g base-index 1

0 comments on commit a687e53

Please sign in to comment.