summaryrefslogtreecommitdiff
path: root/scripts/x-focus-topmost
blob: 8931d646c6409aa59e42d44d0056192661c4cb2a (plain)
1
2
3
4
5
6
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 )