summaryrefslogtreecommitdiff
path: root/scripts/x-root-clean
blob: 25fcbf4be2fe6be71bfb38fa566f1c3f1baf4ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
#
# chromium will spew windows into root, which breaks x-alt-tab, so clean them up
#
pattern="$1"; shift

x-window-list | awk -v parent="" -v pattern="$pattern - " '
	if ( match($0, pattern)) { 
		wid = $3;
		if ( parent == "") {
			parent = wid;
		} else { 
			system(sprintf("xdotool windowreparent %s %s", wid, parent));
		}
	}'