1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-29 01:00:08 +00:00

change pause to play/pause

This commit is contained in:
mahi97 2016-08-31 03:58:15 +04:30
parent 2a5321f4e6
commit 96d57dc33e

View file

@ -335,8 +335,14 @@ function spotify() {
break ;; break ;;
"pause" ) "pause" )
cecho "Pausing Spotify."; state=$(osascript -e 'tell application "Spotify" to player state as string');
osascript -e 'tell application "Spotify" to pause'; if [ "$state" = "playing" ]; then
cecho "Pausing Spotify.";
else
cecho "Playing Spotify.";
fi
osascript -e 'tell application "Spotify" to playpause';
break ;; break ;;
"quit" ) "quit" )