Using the ratpoison window manager
I have been using ratpoison for a couple of years now. In this page I want to share some of my experiences. Maybe they can be usefull for other people.
Being a great fan of GNU Screen, the switch to ratpoison was very natural. The makers of ratpoison were wise enough to choose the same keybindings as GNU Screen. So when you are using GNU Screen on a regular basis then it won't cost you much time to learn ratpoison.
If you do not use GNU Screen regular (shame on you!), learning to use ratpoison will also learn you some basic usage of GNU Screen. Do know that GNU Screen is an awesome tool and you should really invest some time in it.
Reasons why I prefer the ratpoison window manager:
- Less abstractions (there is only one frame visable, which helps to focus on the current job)
- Every pixel counts (no lost of screen real estate on fancy borders)
- Very fast, requires little system resources
- Less use of the mouse
- Works like GNU Screen
- No need to fool around with themes (thus no more complains from my wife that I have choosen an impossible color combination :)
Tools to use with ratpoison
I have found ratmenu to be a very useful tool. This really is an enhancement of ratpoison.
I haven't used the other tools mentioned on the ratpoison homepage very much. During upgrades, re-installs, migrate to other machines I somewhere along the line seem to have "lost" them, I don't have them installed anymore. I do not miss much functionality without them. However, this might be related to my way of using a workstation.
My typical use of the desktop
Most of the time I am working in a shell, through ssh. I have ratpoison configured to use rxvt (without scrollbars). This combination works great. You could choose off course for an alternative virtual terminal, like xterm or aterm. Or perhaps even Konsole (never tried this, but I presume that will also work).
I run ratpoison on all my systems, including my silent diskless workstation.
As you might have guessed, I prefer text mode applications. This includes browsing the web. I use elinks (a text mode webbrowser which provides facilities for tabbed browsing) most of the time. For some webpages I have a little bit more interest in the layout or the graphics, in that case I use firefox.
I use xpdf to view pdfs, occasionally fire up mplayer or gimp. That is about it. The other things can be done in text. From playing mp3s, instant messaging (IRC and IQC), to typing program code in vim.
Ratpoison and GNU Screen
Most of the work I do in terminals I do with the use of GNU Screen. I have configured screen to display some kind of tabs at the bottom of the screen, one tab for each virtual window. Although it varies with the kind of work I am doing, I tend to switch a lot between these virtual windows.
This kind of work combines very good with ratpoison. Because of the heavy use of GNU Screen, the keybindings don't need much thought. Using ratpoison is only natural then. This makes switching from one rxvt-session to another just as easy as switching between virtual windows in GNU Screen.
By it's nature ratpoison does not come with tons of features. Measures against the number of features, ratpoison is extremely configurable. The configuration takes place in the .ratpoisonrc file.
Ratpoison configuration tip 1
Define your own ratpoison escape key.
This is the prefix key that comes before your ratpoison commands (like the Ctrl-A in GNU Screen). What the most optimal key for this is depends mainly on your keyboard layout. Also, you don't want it to sit on your way when using your favorite programs. For me, Ctrl-Z is a great escape key. Both keys are on the lower left corner of my keyboard and the Ctrl-Z combination is normaly used for putting programs in the background. Because I use GNU Screen I don't do this, so there is nothing lost by binding this combination.
Defining your escape key is done by adding a simple line in your .ratpoisonrc:
Ratpoison configuration tip 2
In the many ratpoisonrc files that are floating about on the internet this is the most common configuration:
bind w exec ~/bin/windows. Here, ~/bin/windows is a small bash-script that creates a window list formatted for ratmenu. This makes switching to another frame very easy without loosing much efficiency. This script is flowing around on the internet, here is my copy: ~/bin/windows
Ratpoison configuration tip 3
Use getselThe ratpoison getsel command is a great way to stuff some things into some window.
I use it to select an url and open it in a new tab in firefox. This is how I have configured it in my .ratpoisonrc:
bind f exec firefox --remote "openurl(`$RATPOISON -c getsel`,new-tab)"
Now, you can highlight an url in a window, hit <ratpoison-escape-key> f and the url is opened in a new tab in firefox.
Ratpoison tip 4
The tmpwm command lets you use another window manager for a while. I use this when I have to do something in gimp. For gimp ratpoison is not the most suitable window manager. For this kind of work you could fall back on a simple window manager like twm or vtwm or fvwm. All these are light, have a small footprint and are easy to exit.
Using this command is simple:
<ratpoison-escape-key> : tmpwm <name of temp window manager>
You first hit your ratpoison escape key (in my case: Ctrl-Z), then the : key (command key), then in the command window you type tmpwm followed by the name of your alternative window manager.
When you exit the alternative window manager you will come back in your favorite, aka ratpoison.
Ratpoison tip 5
Some interessing key bindings:
- bind t time: shows the time in the message window.
- bind c exec rxvt -rv +sb -sl 1000 -font 9x15 -ls:
opens a new rxvt session with a good readable font, no scrollbars, white characters on a black background and a scrollback buffer of 1000 lines.
- bind P exec xwd -root > screenshot-`date +%F`:
creates a screenshot with the date into the name. Use convert to create a jpg from this (convert screenshot-`date +%F` awsomeshot.jpg). Convert is part of the great ImageMagick suite.
bind l ratclick 1:
bind v ratclick 2:
Simulate a click on mousebutton 1 (left button) and/or mousebutton 2 (middle mouse button) with your keyboard! Mouse button2 is handy when pasting stuff.
Ratpoison tip 6
Choose your applications well. Start living without that mouse as much as possible. Text mode applications rock. When you want a graphical browser, go for vimperator for mouseless browsing.
Ratpoison tip 7
Unclutter is a small application that removes the cursor image from the screen. So when you have not moved your mouse a few seconds, it will quietly go sit in the corner of your screen.
Put unclutter in your .xinitrc.