mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Merge e50c5a4acb into b75b0b8882
This commit is contained in:
commit
b816bdc54c
1 changed files with 11 additions and 0 deletions
|
|
@ -167,6 +167,16 @@ function itunes() {
|
|||
vol)
|
||||
opt="set sound volume to $1" #$1 Due to the shift
|
||||
;;
|
||||
status|nowplaying)
|
||||
local state=`osascript -e 'tell application "iTunes" to player state as string'`
|
||||
echo "iTunes is currently $state"
|
||||
if [ "$state" = "playing" ]; then
|
||||
artist=`osascript -e 'tell application "iTunes" to artist of current track as string'`
|
||||
track=`osascript -e 'tell application "iTunes" to name of current track as string'`
|
||||
echo "Current track: $artist / $track";
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
shuf|shuff|shuffle)
|
||||
# The shuffle property of current playlist can't be changed in iTunes 12,
|
||||
# so this workaround uses AppleScript to simulate user input instead.
|
||||
|
|
@ -205,6 +215,7 @@ EOF
|
|||
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 "\tvol\tSet the volume, takes an argument from 0 to 100"
|
||||
echo "\tstatus|nowplaying\tShow iTunes status. If playing, shows current artist and track name."
|
||||
echo "\thelp\tshow this message and exit"
|
||||
return 0
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue