Ratpoison

Maybe you don't like desktops. Maybe even a lightweight window manager seems excessive to you. Maybe all you really use is a GUI application or two, and otherwise you're perfectly happy living in a terminal all day. If one or more of these sentiments sounds familiar, then

Ratpoison

is the solution.

Ratpoison [IMG]

The Ratpoison window manager models itself after GNU Screen. All window control is performed with keyboard shortcuts, so you don't have to grab the mouse just to move a window out of your way. The trade-off is that it's impossibly minimalistic, which is, conveniently, also its greatest strength.

Installing Ratpoison

Install Ratpoison from your distribution's software repository. After installing, log out of your current desktop session so you can log in to your new desktop. By default, your session manager (KDM, GDM, Lightdm, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in.

With GDM:

Selecting your desktop in GDM [IMG]

With KDM:

Selecting your desktop in KDM [IMG]

Ratpoison desktop tour

The first time you log in to Ratpoison, you are greeted by a black screen with some text in the upper-right corner telling you that you can press **Ctrl-t** for help.

That's all there is to the Ratpoison desktop.

Interacting with Ratpoison

Ratpoison documentation uses Emacs-style notation for keyboard controls, so I'll tend to use the same notation in this article. If you're unfamiliar with Emacs or GNU Screen, this can look confusing at first, so here's explicit instruction on how to "decode" this style of notation. The Control key on your keyboard is written as `C-`. To trigger Ratpoison's command mode, you press `C-t`, which means that you press **Ctrl-t** just the same way as you would when opening a new tab in your web browser.

The `C-t` shortcut only puts you into command mode, so there's the expectation that some other key sequence is going to follow. For instance, to launch an xterm window, you press `C-t` just as you would when opening a new tab in a web browser, then you press `c`. This may feel a little unnatural at first, because most keyboard shortcuts you're probably used to involve only one action. Ratpoison (and GNU Screen and Emacs) more often involve two.

The first application you probably should launch is either Emacs or a terminal.

In Ratpoison, your terminal is your exclusive gateway to the rest of computer because there's no application menu or icons to click. The default terminal is the humble xterm, and it's available with the `C-t c` shortcut (I remember the `c` as being short for "console").

Launching applications

I usually start with Emacs instead, because it has most of the features I use anyway, including the `shell` terminal and the `dired` file manager. To start an arbitrary application in Ratpoison, press `C-t` and then the `!` (exclamation) symbol. This provides a prompt in the upper-right corner of the screen. Type the command for the application you want to start and press **Return** to launch.

Switching windows

Each application you launch takes over the entire screen by default. That means if you've got

urxvt

running, and then you launch Emacs, you can no longer interact with urxvt. Because switching back and forth between two application windows is a pretty common task, Ratpoison assigns it to the same key as your usual Ratpoison command: `C-t C-t`. That means you press **Ctrl-t** once, and then **Ctrl-t** a second time. This is a toggle, like the default (at least in KDE and GNOME) behaviour of a quick **Alt-tab** key press.

To cycle through all open windows, use `C-t n` for **next** and `C-t p` for **previous**.

Tiling window manager

You're free to use Ratpoison as a fullscreen viewscreen, but most of us are used to seeing more than one window at a time. To allow for that, Ratpoison lets you split your screen into frames or tiles, and then launch an application within each space.

Ratpoison in split screen mode [IMG]

With at least one application open, you can split the screen horizontally with `C-t s` (that's a lowercase "s") or vertically with `C-t S` (that's a capital "S").

To switch to another frame, use `C-t Tab`.

To remove another frame, press `C-t R`.

Moving windows in split screen mode

Rearranging frames once Ratpoison has been split into several parts is done with the **Ctrl** key and a corresponding Arrow key. For instance, suppose you have a vertical split in the top half of your screen, and a single frame as the bottom half. If an application is in the top left frame, and you want to move it to the lower half of the screen, then with that application active (use `C-t Tab` to get there), press `C-t` to enter command mode and then `C-ArrowDown` (that's **Ctrl** with the down arrow key). The application moves to the bottom half of the screen, with the application that took up the bottom half moving into the top left.

To move that application to the top-right frame instead, press `C-t RightArrow`.

To remove the top-left frame entirely, use `C-t R`. This doesn't kill the application in the frame, it only removes the frame from your viewport. The application that once occupied the frame gets sent to the background and can be reached by cycling through the windows as usual (`C-t n`, for instance).

Why you need to try Ratpoison

Ratpoison is a great example of an early (but current) tiling window manager. Other window managers like Ratpoison exist, and some desktops even borrow concepts from this tradition by offering tiling features (Kwin in KDE, for example, has an option to spawn new windows in tiles across the desktop). If you've never used a tiling window manager, you owe it to yourself to try at least once. First make it a goal to use Ratpoison. Then make it a goal to get through a whole afternoon without your mouse. Once you get the hang of it, you might be surprised at how quickly you can work.

Proxied content from gemini://sdf.org/klaatu/geminifiles/advent-ratpoison.gmi (external content)

Gemini request details:

Original URL
gemini://sdf.org/klaatu/geminifiles/advent-ratpoison.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.