diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2017-01-03 13:22:45 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2017-01-03 13:22:45 -0700 |
commit | 46d819df1a131a482618c324099947580f40b276 (patch) | |
tree | 9176b3710b2a313b3bd7a12d5a44325cfe2be281 /plugins/osx/osx.plugin.zsh | |
parent | 0ebfa3a504a0a4de40154432918c5f8acb33bdae (diff) | |
parent | 9f8b2b42bdfee31bb06a93aa0e8b04411727ce58 (diff) | |
download | zsh-46d819df1a131a482618c324099947580f40b276.tar.gz zsh-46d819df1a131a482618c324099947580f40b276.tar.bz2 zsh-46d819df1a131a482618c324099947580f40b276.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/osx/osx.plugin.zsh')
-rw-r--r-- | plugins/osx/osx.plugin.zsh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index d7baa1191..95ef3e1aa 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -323,7 +323,7 @@ function spotify() { if [ $# = 0 ]; then showHelp; else - if [ "$(osascript -e 'application "Spotify" is running')" = "false" ]; then + if [ "$1" != "quit" ] && [ "$(osascript -e 'application "Spotify" is running')" = "false" ]; then osascript -e 'tell application "Spotify" to activate' sleep 2 fi @@ -413,9 +413,13 @@ function spotify() { break ;; "quit" ) - cecho "Quitting Spotify."; - osascript -e 'tell application "Spotify" to quit'; - exit 1 ;; + if [ "$(osascript -e 'application "Spotify" is running')" = "false" ]; then + cecho "Spotify was not running." + else + cecho "Closing Spotify."; + osascript -e 'tell application "Spotify" to quit'; + fi + break ;; "next" ) cecho "Going to next track." ; @@ -470,7 +474,7 @@ function spotify() { "pos" ) cecho "Adjusting Spotify play position." osascript -e "tell application \"Spotify\" to set player position to $2"; - break;; + break ;; "status" ) showStatus; |