提交 9f2acdc4 编写于 作者: A Andy Bateman

You can now use 'itunes status' as well as 'itunes playing' to show current track

上级 29db0e01
......@@ -161,9 +161,9 @@ function itunes() {
vol)
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'`
if [ "$state" = "playing" ]; then
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'`
print -P "Listening to %F{yellow}$currenttrack%f by %F{yellow}$currentartist%f";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册