Using Ratpoison/Your first steps

From Wikibooks, open books for an open world
Jump to navigation Jump to search

As stated in the introduction, these instructions assume a working X system.

Starting ratpoison[edit | edit source]

To launch ratpoison as your default window manager you need to edit the file .xinitrc in your home directory; this might already have been done for you by a package manager. The file ~/.xinitrc should just contain one line:

ratpoison

Now start your X server:

startx

Within a second or two, you'll see a cursor in the middle of the screen superimposed on a dappled grey background, and a small welcome text in the upper right corner that welcomes you to ratpoison. This welcome message instructs you to type in C-t ? if you have any questions. Now is where the fun starts, but first some background on how to interact with and control ratpoison.

The almighty escape key[edit | edit source]

Ratpoison is only controlled by the keyboard; no matter what you click with your mouse on the root window, nothing will happen. Instead, you give it a keyboard command. All ratpoison commands are initiated by typing the escape key sequence. By default, this is Ctrl+t (in Emacs notation, which is preferentially used by ratpoison documentation and users: C‑t). Try typing Ctrl+t, and you'll see that the mouse changes into a white square. This means that ratpoison has taken over the keyboard and is ready to interpret any letter typed as a command (as opposed to normal operation where anything typed is sent to an application to deal with). After typing Ctrl+t, try hit the c key (note that this is a lowercase key; capital C does not currently do anything). Immediately an X terminal opens up and takes over the screen (assuming xterm is installed as it usually is); in other words, the command c creates a console window. Now you can do anything you could do on the command line, and you can even run your graphical programs like Firefox – ratpoison will automatically switch to the newest windows.

Note that if constantly pressing Ctrl+t to prefix all commands is uncomfortable (if you, for example are using the Dvorak keyboard layout) you can change it dynamically or in the configuration file. Please see one of the advanced chapters for more information on adjusting key bindings.

Key strokes[edit | edit source]

Try a few different key strokes – you can find the command list in the ratpoison manual or info documentation, or you can type Ctrl+t ?, which will give a brief list of sequences. Remember, all key strokes are preceded with Ctrl+t.

A useful pair of commands are Ctrl+t n (shifts your view to the next window; like conventional alt+Tab ↹) and its inverse Ctrl+t p (shifts your view to the previous window; if you just Ctrl+t n'ed, for example, a Ctrl+t p will take you back to the original window).