mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Added itunes status command
This commit is contained in:
parent
8921902388
commit
a1e0ca9c88
1 changed files with 10 additions and 0 deletions
|
|
@ -161,6 +161,16 @@ function itunes() {
|
|||
vol)
|
||||
opt="set sound volume to $1" #$1 Due to the shift
|
||||
;;
|
||||
status)
|
||||
its_status=`osascript -e 'tell application "iTunes" to player state as string'`
|
||||
echo "iTunes is currently $its_status"
|
||||
if [ "$its_status" = "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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue