summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim O'Brien <timo@t413.com>2014-11-08 14:16:56 -0800
committerTim O'Brien <timo@t413.com>2014-11-08 14:16:56 -0800
commit98fc8dd91adb5e8754b857127c4d121871d5fadb (patch)
treeb108c8553163c7b2b7be8d03a374a0a08c50cee2
parentcbec1d77b2b238eadcdad5d926339d4a034240e9 (diff)
downloadzsh-98fc8dd91adb5e8754b857127c4d121871d5fadb.tar.gz
zsh-98fc8dd91adb5e8754b857127c4d121871d5fadb.tar.bz2
zsh-98fc8dd91adb5e8754b857127c4d121871d5fadb.zip
Fix for OS X when no window id is returned (like on the desktop)
-rwxr-xr-xplugins/bgnotify/bgnotify.plugin.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
index f3cf0e3b8..259d27424 100755
--- a/plugins/bgnotify/bgnotify.plugin.zsh
+++ b/plugins/bgnotify/bgnotify.plugin.zsh
@@ -24,7 +24,7 @@ currentWindowId () {
if hash notify-send 2>/dev/null; then #ubuntu!
xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
elif hash osascript 2>/dev/null; then #osx
- osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null
+ osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
else
echo $EPOCHSECONDS #fallback for windows
fi