summaryrefslogtreecommitdiff
path: root/scripts/x-root-clean
diff options
context:
space:
mode:
authorPatrick <phaller@localhost.localdomain>2014-02-02 15:12:40 +0800
committerPatrick <phaller@localhost.localdomain>2014-02-02 15:12:40 +0800
commitbef55f10d9d7d3e2a9b4510c1df4a3b8dfd56c1e (patch)
treec55d875cb002b2d52ecb0639e92a151b41e92592 /scripts/x-root-clean
parentbfae5ddfca31f42010241811571085fa6ac9bd72 (diff)
added helper xdotool scripts
Diffstat (limited to 'scripts/x-root-clean')
-rwxr-xr-xscripts/x-root-clean15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/x-root-clean b/scripts/x-root-clean
new file mode 100755
index 0000000..25fcbf4
--- /dev/null
+++ b/scripts/x-root-clean
@@ -0,0 +1,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));
+ }
+ }'