Use ratmen to select a ratpoison window on FreeBSD

Last edited

Rebuild ~/bin/windows to select ratpoison windows without bash

Ratpoison window manager

(Ratpoison)[] is a great window manager that let you use all your pixels. No pixel is waisted on decoration or any other stuff.

Ratpoison is designed to be used without a mouse (hence the name).

I am using this window manager for many years now. Nothing can beat it in terms of efficiency. No mouse is fast and is more healthy for your wrists. And did I mention that it is fast?


Accoording to the README, ratmen is like ratmenu but only better.

Selecting windows

On the internet float a lot of examples of a small shellscript to quickly get a menu of all your ratpoison windows. This shell script however uses bash.

In FreeBSD bash is not among the default shells. That is why I have tried to come up with a ~/bin/windows that does not depend on bash. For this, I turned to our favorite tool: awk

Below is a small shell script that does the same trick, without bash.


ratpoison -c 'windows %l;%n;%t' | sort -nr | \
awk -F';' 'BEGIN{ printf "ratmen "} \
{ printf "'\\\"'%s: %s'\\\"' '\\\"'ratpoison -c '\''select %s'\'''\\\"' ", \
$2, $3, $2 }' | sh

Have fun!