mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Update osx.plugin.zsh
Added function to display the song you're currently listening to in iTunes Fixed indent Indentation on line 169 was squiffy Fixed spelling Removed unnecessary wording to make function more succinct. Highlighting of Artist and Track Changed the highlighting of the Track and Artist in yellow to make use of Prompt Expansion Colors
This commit is contained in:
parent
9c08641d7c
commit
a746e6010a
1 changed files with 10 additions and 0 deletions
|
@ -161,6 +161,15 @@ function itunes() {
|
||||||
vol)
|
vol)
|
||||||
opt="set sound volume to $1" #$1 Due to the shift
|
opt="set sound volume to $1" #$1 Due to the shift
|
||||||
;;
|
;;
|
||||||
|
playing)
|
||||||
|
local state=`osascript -e 'tell application "iTunes" to player state as string'`
|
||||||
|
if [ "$state" = "playing" ]; then
|
||||||
|
currenttrack=`osascript -e 'tell application "iTunes" to name of current track as string'`
|
||||||
|
currentartist=`osascript -e 'tell application "iTunes" to artist of current track as string'`
|
||||||
|
echo "Listening to %F{yellow}$currenttrack%f by %F{yellow}$currentartist%f";
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
shuf|shuff|shuffle)
|
shuf|shuff|shuffle)
|
||||||
# The shuffle property of current playlist can't be changed in iTunes 12,
|
# The shuffle property of current playlist can't be changed in iTunes 12,
|
||||||
# so this workaround uses AppleScript to simulate user input instead.
|
# so this workaround uses AppleScript to simulate user input instead.
|
||||||
|
@ -199,6 +208,7 @@ EOF
|
||||||
echo "\tnext|previous\tplay next or previous track"
|
echo "\tnext|previous\tplay next or previous track"
|
||||||
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
|
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
|
||||||
echo "\tvol\tSet the volume, takes an argument from 0 to 100"
|
echo "\tvol\tSet the volume, takes an argument from 0 to 100"
|
||||||
|
echo "\tplaying\tShow what song is currently playing in iTunes."
|
||||||
echo "\thelp\tshow this message and exit"
|
echo "\thelp\tshow this message and exit"
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue