diff options
| author | Marc Cornellà <marc.cornella@live.com> | 2019-05-08 20:40:36 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-08 20:40:36 +0200 | 
| commit | 0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch) | |
| tree | 946d9f8b758ebdd63da96152ca56b154c99068da /plugins/osx/spotify | |
| parent | afb028763cf40fc339e49011b2cba124dc108fcb (diff) | |
| parent | ebc700be9b2fa7ae770a644093a5c46a8e323726 (diff) | |
| download | zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2 zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip  | |
Merge branch 'master' into master
Diffstat (limited to 'plugins/osx/spotify')
| -rw-r--r-- | plugins/osx/spotify | 13 | 
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/osx/spotify b/plugins/osx/spotify index 69f6c5419..b4215dbe7 100644 --- a/plugins/osx/spotify +++ b/plugins/osx/spotify @@ -1,7 +1,7 @@  #!/usr/bin/env bash  function spotify() { -# Copyright (c) 2012--2017 Harish Narayanan <mail@harishnarayanan.org> +# Copyright (c) 2012--2018 Harish Narayanan <mail@harishnarayanan.org>  #  # Contains numerous helpful contributions from Jorge Colindres, Thomas  # Pritchard, iLan Epstein, Gabriele Bonetti, Sean Heller, Eric Martin @@ -134,8 +134,13 @@ showStatus () {  if [ $# = 0 ]; then      showHelp;  else +	if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then +		echo "The Spotify application must be installed." +		exit 1 +	fi +      if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then -        osascript -e 'tell application "Spotify" to activate' +        osascript -e 'tell application "Spotify" to activate' || exit 1          sleep 2      fi  fi @@ -160,7 +165,7 @@ while [ $# -gt 0 ]; do                      showAPIHelp;                      exit 1;                  fi -                SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"); +                SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r');                  SPOTIFY_PLAY_URI="";                  getAccessToken() { @@ -408,7 +413,7 @@ while [ $# -gt 0 ]; do              uri=`osascript -e 'tell application "Spotify" to spotify url of current track'`;              remove='spotify:track:'              url=${uri#$remove} -            url="http://open.spotify.com/track/$url" +            url="https://open.spotify.com/track/$url"              if [ "$2" = "" ]; then                  cecho "Spotify URL: $url"  | 
