Skip to content

Instantly share code, notes, and snippets.

@zmughal
Created February 18, 2011 05:09
Show Gist options
  • Save zmughal/833279 to your computer and use it in GitHub Desktop.
Save zmughal/833279 to your computer and use it in GitHub Desktop.
Window chooser
#!/bin/sh
# reqs: wmctrl, zenity
wmctrl -l \
| sed 's/\([^ ]\+\) \+\([^ ]\+\) \+\([^ ]\+\) \+\(.*\)$/\1:\4/' \
| grep -v "^0x[0-9a-f]\+:$" \
| sed 's/\(0x[0-9a-f]\+\):\(.\+\)/\1\n\2/' \
| zenity --list --title "Windows" --text "Window list" --column="ID" \
--column "Window" --hide-column=1 \
| xargs wmctrl -i -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment