summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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 )