1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/modules/notify/functions/focused_window_id

21 lines
456 B

12 years ago
# Gets the id of the current focused window.
#
# Authors:
# Alex Reece <awreece@gmail.com>
#
case "$OSTYPE" in
(darwin*)
osascript -e 'tell application (path to frontmost application as text) ¬' \
-e ' to get id of front window'
;;
(linux-gnu*)
# http://stackoverflow.com/a/8688624/447288
xprop -root -f _NET_ACTIVE_WINDOW 0x ' $0' _NET_ACTIVE_WINDOW \
| awk '{print $2}'
;;
(*)
return 1
;;
esac