Ratpoison Window Manager



by hootiegibbon


As some of our forum members will testify, I am known - among other things - for typos and a love for 'left of center' applications and window managers.

Ratpoison window manager is one of these. When you first boot into a ratpoison session, you may mistakenly think that it is just a blank screen, that something has gone wrong, and move onto another window manager - like Kwin or IceWM.

Ratpoison is not specifically a tiling manager, although it does do manual tiling if you want it to.

Ratpoison as a window manager is oblivious to the mouse. It’s keyboard and keybinding driven. That's not to say you cannot use the mouse with the apps you use while using ratpoison. I still use my laptop’s trackpoint within my browser, xxxterm.

Although ratpoison is very lightweight, it is not necessarily designed for older machines. However, due to how it manages windows, it is an extremely good choice for smaller screens, as you can deal with one window-decoration-free full screen app, that really is full screen. On larger and multi screen set ups, you can have dedicated tiles that fully capture your keyboard when you select a particular window, until you release or move the mouse and keyboard to another tile or window.

All configuration is carried out through a file called .ratpoisonrc. This allows you to change, (from what I have experienced), any part of the window manager usage configuration .

Here is a link to my .ratpoisonrc file (referred to below as mrp - my .ratpoisonrc). Feel free to use it and change it if you wish.

Commands are passed to the window manager by first escaping normal keyboard function. This is done by the use of what is known as an 'escape key.' By default, it is set to 'Ctrl + T,' which to me is not a sane choice, so I used ratpoisonrc to change this to use the right Control key (on its own). This is handy, as it allow me to use either hand to enter the window manager command mode. In order to see what all the available commands are, you would use ‘escape key + ?.’

Okay. So if I have persuaded you to try ratpoison out, lets try it a little.

While facing the initial black screen, use the defined escape key then c. This launches a single screen xterm terminal. If you are using mrp and have Sakura installed, just use Shift + Winkey + Enter to launch an instance of Sakura. It should look like this:

Now that you have a full page app, let’s split the screen. To do this, use the defined escape key + Shift+S to get a vertical split. To move into the new split, use the defined escape key + right arrow, then repeat the launch sequence for the terminal. It should then look like this:

Okay. Lets do one more split.

This time, let’s split the screen horizontally. To do this, use the defined escape key + S. Then use defined escape key + down arrow to move into it. Once again, launch a terminal. It should now look like this”

Now, you should have three tiles. Each of these tiles can have almost unlimited numbers of apps within them, with one being in focus at a time (Gnu-screen users will be familiar with many aspects of this).

To quickly navigate between tiles, use the defined escape key + F. This will number each tile. Select a number to move focus to that tile. As a shortcut, if you know the number, you can use the defined escape key + number to move the focus to that particular tile. Alternatively, to see a list of all windows available use, use the defined escape key + W, which produces a list for you to see the numbers.

Okay. so let’s navigate to the large window. There, we are going to launch a web browser. In order to do this, it’s best to have a shortcut set up. I have mrp set up to launch xxxterm if I use the Winkey + F1. You can edit that entry to have your favorite browser launch instead. If using the default, you will need to launch a bash command to do this. Use the defined escape key + ! and type in the app name.

You will now have four apps – three copies of xterm and one copy of xxxterm – running, and three tiled 'screens' to view them on.

To change between the windows on your display (like flipping pages in a book), you can either use the defined escape key + N (Next) or the defined escape key + P (Previous). If you are using mrp, the Winkey + XF86Back or Winkey + XF86Forward (page back on your keyboard, and  sometimes Alt + Right and Alt + Left arrows, although you may have a dedicated key, like I do on my Thinkpad keyboard).  

In order to kill an application, you can use the defined escape key + K. If you are using mrp, you can use the Shift + Winkey + Esc.

As for what applications work well with ratpoison, you can basically use any with good configurable keybindings. Here is a short list of ones that I found that work well, to get you started.

Graphical Web Browsers:

xxxterm  (in repo - tabbing)

Jumanji (in repo - tabbing)

surf (in repo - non-tabbing - instead of tabs launch single instances and "flip" though the windows using the defined escape key + N or P)

Vimperator (an add-on for Firefox)

Vimprobable2 (non-tabbing webkit browser - more advanced than surf - this is a package that i would love to build or have it built)

Email Client

alpine

mutt (need to get my head around its config)

sylpheed

IRC Client

irssi

weechat-ncurses

xchat

In fact, the only apps that I have found that do not play well are those that have more than one window to start with (Gimp, for example). For these, there are two ways to deal with them. First, you can "unmanage" them using the ratpoison command unmanage [name]. Here is how the “unmanage” command is defined:

Add name to the list of unmanaged  windows.   Thus,  windows  of this  name will not be managed but allowed to choose their position themselves.

In non-interactive mode calling it without arguments will  print the list.

The list can be cleared again by calling clrunmanaged.

The second way is to use the tmpwm command. The “tmpwm” command is defined like this:

tmpwm WM

Temporarily give control over to another window manager, reclaiming control when that WM terminates.

I hope this little tutorial has been useful in getting some basic ratpoison experience. The best two resources are to check out all the command sequences (defined escape key + ?) and, of course, the ratpoison manpage.

To keep up on the latest discussion involving the ratpoison window manager, please check out the ratpoison thread in the PCLinuxOS Forum.