From 96d57dc33ec7ce473a7ce06d7c0166eabd14e1c8 Mon Sep 17 00:00:00 2001 From: mahi97 Date: Wed, 31 Aug 2016 03:58:15 +0430 Subject: [PATCH] change pause to play/pause --- plugins/osx/osx.plugin.zsh | 10 ++++++++-- 1 file 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" )