change pause to play/pause

This commit is contained in:
mahi97 2016-08-31 03:58:15 +04:30
parent 2a5321f4e6
commit 96d57dc33e
1 changed files with 8 additions and 2 deletions

View File

@ -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" )