summaryrefslogtreecommitdiff
path: root/plugins/osx
diff options
context:
space:
mode:
authormahi97 <mohammadmahdi76@gmail.com>2016-08-31 03:58:15 +0430
committermahi97 <mohammadmahdi76@gmail.com>2016-08-31 03:58:15 +0430
commit96d57dc33ec7ce473a7ce06d7c0166eabd14e1c8 (patch)
treee45001f6af3157a5da9c25a25530d1d5f631a659 /plugins/osx
parent2a5321f4e69b55f626c94993a40b1dee6a73c26f (diff)
downloadzsh-96d57dc33ec7ce473a7ce06d7c0166eabd14e1c8.tar.gz
zsh-96d57dc33ec7ce473a7ce06d7c0166eabd14e1c8.tar.bz2
zsh-96d57dc33ec7ce473a7ce06d7c0166eabd14e1c8.zip
change pause to play/pause
Diffstat (limited to 'plugins/osx')
-rw-r--r--plugins/osx/osx.plugin.zsh10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 19acd3dd5..058576f0b 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -335,8 +335,14 @@ function spotify() {
break ;;
"pause" )
- cecho "Pausing Spotify.";
- osascript -e 'tell application "Spotify" to pause';
+ state=$(osascript -e 'tell application "Spotify" to player state as string');
+ if [ "$state" = "playing" ]; then
+ cecho "Pausing Spotify.";
+ else
+ cecho "Playing Spotify.";
+ fi
+
+ osascript -e 'tell application "Spotify" to playpause';
break ;;
"quit" )