To have the executables available in Ubuntu or Debian:
apt-get install suckless-tools
Keyboard shortcut command to choose from all windows:
/bin/sh -c 'wmctrl -l | while read i j k l; do echo $i $l; done | dmenu -i -l 16 | awk "{print \$1}" | while read i; do wmctrl -iR $i; done'
Keyboard shortcut command to choose from windows of the same process as currently active window: