From 65708708284a2bbf047dd198fd7e0ee051505d6b Mon Sep 17 00:00:00 2001 From: Ian Walker Date: Mon, 15 Jun 2015 22:21:00 +0900 Subject: [PATCH] Cleaned up the code a bit --- plugins/osx/osx.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index e407404a6..9f0487051 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -161,10 +161,10 @@ 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 + 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";