From 6a300385fb7085f6d25191fd5db9d546618937db Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Wed, 13 Jun 2012 16:23:41 -0500 Subject: [PATCH] Added iTunes current track. Also found out that I can put each of these in separate variables and then include them, making it easier to maintain --- bin/itunes.applescript | 12 ++++++++++++ tmux/tmux.conf.symlink | 18 ++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 bin/itunes.applescript diff --git a/bin/itunes.applescript b/bin/itunes.applescript new file mode 100644 index 0000000..d4b81f4 --- /dev/null +++ b/bin/itunes.applescript @@ -0,0 +1,12 @@ +if application "iTunes" is running then + tell application "iTunes" + if exists current track then + set theName to the name of the current track + set theArtist to the artist of the current track + try + return theName & " - " & theArtist + on error err + end try + end if + end tell +end if diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index 2cf815f..8f24ed3 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -106,12 +106,26 @@ set-option -g display-panes-colour colour166 # clock set-window-option -g clock-mode-colour colour39 -# + +################## +#### Plugins ##### +################## + +# current Spotify track +spotify_track='#[fg=colour82]#(osascript ~/.dotfiles/bin/spotify.applescript)' +# current iTunes track +itunes_track='#[fg=colour27]#(osascript ~/.dotfiles/bin/itunes.applescript)' + +tm_date='#[fg=colour245]⮃ %R ⮃ %d %b' +tm_host='#[fg=colour39,bg=colour234,bold]#h' + set -g status-left-length 32 set -g status-right-length 150 set -g status-interval 5 set -g window-status-format "#[fg=colour239,bg=colour234] #I #W " + + set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour16,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" set -g status-left '#[fg=colour39,bg=colour234,bold] #S' -set -g status-right '#[fg=colour82]#(osascript ~/.dotfiles/bin/spotify.applescript) #[fg=colour245]⮃ %R ⮃ %d %b #[fg=colour39,bg=colour234,bold] #h ' +set -g status-right $itunes_track' '$spotify_track' '$tm_date' '$tm_host