Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
98fc8dd9
Commit
98fc8dd9
authored
Nov 08, 2014
by
Tim O'Brien
Browse files
Fix for OS X when no window id is returned (like on the desktop)
parent
cbec1d77
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/bgnotify/bgnotify.plugin.zsh
View file @
98fc8dd9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment