mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
add spotify controls to osx plugin
This commit is contained in:
parent
357ab4912b
commit
1c57fb7596
1 changed files with 26 additions and 0 deletions
|
|
@ -191,3 +191,29 @@ function itunes() {
|
||||||
osascript -e "tell application \"iTunes\" to $opt"
|
osascript -e "tell application \"iTunes\" to $opt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Spotify control function
|
||||||
|
function spotify() {
|
||||||
|
local opt=$1
|
||||||
|
shift
|
||||||
|
case "$opt" in
|
||||||
|
launch|play|pause|quit)
|
||||||
|
;;
|
||||||
|
next|previous)
|
||||||
|
opt="$opt track"
|
||||||
|
;;
|
||||||
|
""|-h|--help)
|
||||||
|
echo "Usage: spotify <option>"
|
||||||
|
echo "option:"
|
||||||
|
echo "\tlaunch|play|pause|quit"
|
||||||
|
echo "\tnext|previous\tplay next or previous track"
|
||||||
|
echo "\thelp\tshow this message and exit"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
print "Unknown option: $opt"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
osascript -e "tell application \"Spotify\" to $opt"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue