From 1041d53ac4a2a75188e4927e2b9bd5d6e18e700e Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Thu, 31 Dec 2015 12:01:58 -0600 Subject: [PATCH] Remove rdio support, combine spotify and itunes * remove rdio.scpt for detecting currently playing rdio trip. RIP * combine iTunes and Spotify scripts together into a single, tunes.scpt --- applescripts/itunes.scpt | 12 ------------ applescripts/rdio.scpt | 10 ---------- applescripts/spotify.scpt | 12 ------------ applescripts/tunes.scpt | 24 ++++++++++++++++++++++++ tmux/theme.sh | 6 ++---- 5 files changed, 26 insertions(+), 38 deletions(-) delete mode 100755 applescripts/itunes.scpt delete mode 100755 applescripts/rdio.scpt delete mode 100755 applescripts/spotify.scpt create mode 100755 applescripts/tunes.scpt diff --git a/applescripts/itunes.scpt b/applescripts/itunes.scpt deleted file mode 100755 index 1e3febc..0000000 --- a/applescripts/itunes.scpt +++ /dev/null @@ -1,12 +0,0 @@ -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/applescripts/rdio.scpt b/applescripts/rdio.scpt deleted file mode 100755 index 1c6a577..0000000 --- a/applescripts/rdio.scpt +++ /dev/null @@ -1,10 +0,0 @@ -if application "Rdio" is running then - tell application "Rdio" - set theName to name of the current track - set theArtist to artist of the current track - try - return "♫ " & theName & " - " & theArtist - on error err - end try - end tell -end if diff --git a/applescripts/spotify.scpt b/applescripts/spotify.scpt deleted file mode 100755 index a42d37d..0000000 --- a/applescripts/spotify.scpt +++ /dev/null @@ -1,12 +0,0 @@ -if application "Spotify" is running then - tell application "Spotify" - set theName to name of the current track - set theArtist to artist of the current track - set theAlbum to album of the current track - set theUrl to spotify url of the current track - try - return "♫ " & theName & " - " & theArtist - on error err - end try - end tell -end if diff --git a/applescripts/tunes.scpt b/applescripts/tunes.scpt new file mode 100755 index 0000000..2cae174 --- /dev/null +++ b/applescripts/tunes.scpt @@ -0,0 +1,24 @@ +(* Get the current song from iTunes or Spotify *) +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 +else if application "Spotify" is running then + tell application "Spotify" + set theName to name of the current track + set theArtist to artist of the current track + set theAlbum to album of the current track + set theUrl to spotify url of the current track + try + return "♫ " & theName & " - " & theArtist + on error err + end try + end tell +end if diff --git a/tmux/theme.sh b/tmux/theme.sh index fb8690e..5422413 100644 --- a/tmux/theme.sh +++ b/tmux/theme.sh @@ -49,9 +49,7 @@ set-option -g display-panes-colour $tm_color_inactive # clock set-window-option -g clock-mode-colour $tm_color_active -tm_spotify="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/spotify.scpt)" -tm_itunes="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/itunes.scpt)" -tm_rdio="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/rdio.scpt)" +tm_tunes="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/tunes.scpt)" tm_battery="#(~/.dotfiles/bin/battery_indicator.sh)" tm_date="#[fg=$tm_color_inactive] %R %d %b" @@ -59,4 +57,4 @@ tm_host="#[fg=$tm_color_feature,bold]#h" tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S" set -g status-left $tm_session_name' ' -set -g status-right $tm_itunes' '$tm_date' '$tm_host +set -g status-right $tm_tunes' '$tm_date' '$tm_host