98fc8dd91adb5e8754b857127c4d121871d5fadb

Author
Tim O'Brien <timo@t413.com>
Committer
Tim O'Brien <timo@t413.com>
Date

Message

Fix for OS X when no window id is returned (like on the desktop)

Diff

 1diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
 2index f3cf0e3b81ce1f97797472c595f98cd5348ee5da..259d27424c8e18edef9e98affad2d902f3892851 100755
 3--- a/plugins/bgnotify/bgnotify.plugin.zsh
 4+++ b/plugins/bgnotify/bgnotify.plugin.zsh
 5@@ -24,7 +24,7 @@ currentWindowId () {
 6   if hash notify-send 2>/dev/null; then #ubuntu!
 7     xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
 8   elif hash osascript 2>/dev/null; then #osx
 9-    osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null
10+    osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
11   else
12     echo $EPOCHSECONDS #fallback for windows
13   fi