summaryrefslogtreecommitdiff
path: root/scripts/x-focus-topmost
diff options
context:
space:
mode:
authorPatrick <devnull@mailinator.com>2017-06-11 19:04:07 +0800
committerPatrick <devnull@mailinator.com>2017-06-11 19:04:07 +0800
commit9385c245df13ad126e8c91bf95800e8d0d4ccbea (patch)
treef8fec7174863b794ca094be15c435aab5eb1ecc7 /scripts/x-focus-topmost
parent9949f1867f3c09c7cc51d68f057b33f4495e6b37 (diff)
add support for make install to make everything, init x-focus-topmost script
Diffstat (limited to 'scripts/x-focus-topmost')
-rwxr-xr-xscripts/x-focus-topmost7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/x-focus-topmost b/scripts/x-focus-topmost
new file mode 100755
index 0000000..8931d64
--- /dev/null
+++ b/scripts/x-focus-topmost
@@ -0,0 +1,7 @@
+#!/bin/sh
+# focus the top-most window, i.e. the window just mapped
+topmost() {
+ xwininfo -root -children | awk '/^ *0x/{ print $1; exit; }'
+}
+[[ "$1" != "" ]] && sleep 0.5
+xdotool windowfocus $( topmost )