diff options
author | Andy Bateman <andy@andybateman.com> | 2015-09-17 18:28:48 +1200 |
---|---|---|
committer | Andy Bateman <andy@andybateman.com> | 2015-09-22 08:15:31 +1200 |
commit | 9f2acdc445f05e6556cf6180a1edd52b6939bbcc (patch) | |
tree | 332ef11e91f9bb212f8439c18dae4f78b80d3d0a /plugins | |
parent | 29db0e0119aba4f317ac320ed5089b82142bcb10 (diff) | |
download | zsh-9f2acdc445f05e6556cf6180a1edd52b6939bbcc.tar.gz zsh-9f2acdc445f05e6556cf6180a1edd52b6939bbcc.tar.bz2 zsh-9f2acdc445f05e6556cf6180a1edd52b6939bbcc.zip |
You can now use 'itunes status' as well as 'itunes playing' to show current track
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/osx/osx.plugin.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index f1b437189..859e08da5 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -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"; |