mirror of
https://gitee.com/mirrors/ohmyzsh.git
synced 2026-10-15 07:46:45 +08:00
You can now use 'itunes status' as well as 'itunes playing' to show current track
This commit is contained in:
1 parent
29db0e0119
commit
9f2acdc445
1 file changed
+2
-2
@@ -161,9 +161,9 @@ 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)
|
playing|status)
|
||||||
local state=`osascript -e 'tell application "iTunes" to player state as string'`
|
local state=`osascript -e 'tell application "iTunes" to player state as string'`
|
||||||
if [ "$state" = "playing" ]; then
|
if [[ "$state" = "playing" ]]; then
|
||||||
currenttrack=`osascript -e 'tell application "iTunes" to name of current track as string'`
|
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'`
|
currentartist=`osascript -e 'tell application "iTunes" to artist of current track as string'`
|
||||||
print -P "Listening to %F{yellow}$currenttrack%f by %F{yellow}$currentartist%f";
|
print -P "Listening to %F{yellow}$currenttrack%f by %F{yellow}$currentartist%f";
|
||||||
|
|||||||
Reference in new issue
Block a user