I often have many windows open (mostly with pdf files I need to read), and
try to come up with a tool that lets me find and focus a window easily. I
now simply list all windows with xwininfo and feed that to dmenu. But the
list is full of invisible/dummy windows I don't care about. I clean the
list somewhat with sed, but I can't figure out how to cleverly filter out
all the unwanted windows in the list. See the attached scripts. Does anyone
know a solution for this? Is there an existing tool that lists all
"visible" windows along with their id?
#!/bin/sh
wmctrl -i -a $(windowlist | dmenu -i -l 50)
#!/bin/sh
xwininfo -tree -root \
| sed 's/\s\+//' \
| grep '^0x[^ ]* "[^<]' \
| sed 's/") [1-90].*/")/' \
| grep -v ': ()' \
| grep -v 'Qt-subapplication' \
| grep -v '" ":' \
| grep -v '"GnuCash":' \
| grep -v '"keepassx":' \
| grep -v '"knotify4":' \
| grep -v '"kded4":' \
| grep -v '"opera":' \
| grep -v '"Opera":' \
| grep -v '"operapluginwrapper":' \
| grep -v '"surf":' \
| grep -v '"Vim":' \
| grep -v '"VIM":' \
| grep -v '"Worker":' \
| grep -v '"xautolock":' \
| grep -v '"XOSD":'