HOWTO: My Ratpoison Configuration (Correction update)

Share your wisdom. Not for support questions!

Moderator: How-to Curator

HOWTO: My Ratpoison Configuration (Correction update)

Postby Lou » July 27th, 2014, 3:11 pm

HOWTO: My Ratpoison Configuration (verbosísimo)

This little window manager (wm) is, IMHO, misunderstood, maligned; it uses about
1,5 MB of RAM, faster than a bullet. Great for boxes with little ram and processors
not powerful (worked great on my box with an Atom processor/1 gig ram)), beloved by gamers
who generally are misers with their RAM (i've seen gamers with 6 gigs of ram using rp).

For laptops, netbooks, this is it, baby!
Gives you a lot of real estate on little screens. I put it in my grandaughter's netbook, she loves it.
Now she thinks i'm kool :)

The main misconception is, that users cannot use the mouse, just keybindings.
Which is not true.

It has many options, which i don't know because my needs are basic, but it does
the job for me. If I had to write a profile on the majority of its users, i would
say they are definitely, a different breed.

They can't care less about looks, themes, and eye-candy, their main thing is
SPEED! They try not use the mouse too often (carpal tunnel), but they do, and basically,
it is a no-nonsense window manager. They feel they are above the Windows philosophy
of little birds flying on the desktop. Ratpoison is NOT for everybody.

No titlebar, no taskbar, no date, no floating apps, no themes, everything is maximized, no
discussions about "my destop is prettier than yours".
Ratpoison has a way of putting things that are absolutely necesary in its place.

They put those things like date, windows, etc on call only by keybinds. Which to
me is great when "i am in the zone" translating, the last thing i need is distraction.

Together with iceweasel/firefox addon Vimperator, is unbeatable.

I'm no expert, just use the parts that help me. Let's get down:


Code: Select all
# apt-get install ratpoison menu

Ratpoison is at first pretty ugly and the mouse cursor is an X, so you have to configure it.
The best way to configure is to do it from ANOTHER wm or DE.

The way it works is: you press a 'bind' key plus another letter you assign to a package
you want to launch.

In my opinion it's easier to do this configuration from the window manager or
whatever desktop environment you're using at the moment.

The default keybind (or bind key) is C-t (Control + letter t) but to me, it's cumbersome
and painful on the wrist or fingers. Besides, i use C-t to create a new tab in Iceweasel/Firefox.

If you google you'll find tons of material on '.ratpoisonrc' or 'ratpoison configuration' .

Your bind key can be the default C-t (control+t), or anything that is confortable
for your fingers, that comes to you automatically.

Another bind key that is popular is C-z (control+z). It can be an Fn key, whatever :)

My favorite is making the Caps Lock key, the bind key (next to your left pinky).
Thanks to Dion Moult and this article

First, we create the .xmodmaprc:

Code: Select all
$ touch .xmodmaprc

then edit it with your favorite editor and paste this:

Code: Select all
remove lock = Caps_Lock
keycode 66 = F13

Put xmodmaprc in your .xinitrc:

Code: Select all
xmodmap .xmodmaprc

Create the .ratpoisonrc file
Code: Select all
$ touch .ratpoisonrc

You'll notice is blank, then paste and post something like this:

Code: Select all
alias term exec xterm    # or your favorite terminal
escape F13               # this is the bind key

exec xrdb -merge "$HOME"/.Xdefaults
warp on
startup_message off
set winname class
defborder 0
set padding 0 0 0 0
defbarpadding 0 0
exec xsetroot -solid black -cursor_name left_ptr
bind semicolon colon
set bargravity nw         #the box can be anywhere ne,se,sw
set winfmt %n %s %t
set fgcolor yellow        #it can be red
set bgcolor black
set font "Terminus-12"

alias showroot exec ratpoison -c fdump; ratpoison -c 'select -' -c only
alias unshowroot exec ratpoison -c "frestore at $HOME/.rpfdump"

### Escritorios virtuales/Workspaces
exec rpws 1
exec /usr/bin/rpws init 6 -k

## bind = F13
bind F1 exec rpws 1            # to go to a workspace #
bind F2 exec rpws 2
bind F3 exec rpws 3

#Focus and exchange of frames
unbind k
bind j focusdown
bind h focusleft
bind k focusup
bind l focusright
bind J exchangedown
bind H exchangeleft
bind K exchangeup
bind L exchangerigh

definekey top M-Tab next          # Alt-tab or you can hit the bind key twice
definekey top M-ISO_Left_Tab prev

# Atajos de teclas
definekey top F1 exec xterm
definekey top F2 exec xfe
definekey top F5 exec sudo /sbin/poweroff -p
definekey top F6 exec sudo /sbin/reboot
definekey top F3 exec medit
definekey top F4 kill
bind f exec iceweasel
bind m exec sylpheed
bind u exec xchat
bind r restart
bind w windows

bind Escape abort
bind q only

rudeness 12     # DON'T ASK - I KNOW NOTHING

##To launch a Run box (Ctrl+Space bar):
definekey top C-space exec

# To make a screenshot (Press the Print key)
definekey top Print exec xterm -e scrot -cd 10

# Sound Volume
bind Up exec amixer -q set Master 6%+      #increase volume
bind Down exec amixer -q set Master 6%-    #lower volume
bind 0 exec amixer -q set Master 0         #mutes sound

To launch an app, e.g. iceweasel: press bind key (caps lock) a white small X will appear
and then press the letter 'f', and the browser (or whatever you specify in .ratpoisonrc) will appear.

To launch xterm just press F1 and so forth, no biggie...ditto for all the other apps.

If you want to change the 'bind' key just edit the .ratpoisonrc, say you want C-z, edit it:

Code: Select all
escape C-z

save/exit/restart (bind+r)

The 'set bargravity' is the location where the box where the date, run box is, the location is where it's easier for you to see.
Example: i like it on top and to my left, thus: nw
If you want it down on your right of the screen: se

You want to abort in the middle of an operation?
Press the Escape (Esc key).

Close an app?
Press F4

What windows you got open?
bind + w

Want to go to one of them?
bind + the window #

Want to launch the Debian menu?
bind + period (.), use the up/down arrows, press Enter

After every change 'restart rp' with:
bind + r

What time/date is it?
bind + a

press the Print key.

You miss fbrun?
Press the Control key + Space bar

If you want to split the screen horizontally:
bind + s

Bind + S

Go back to normal?
Bind + q

To halt or reboot (F5/F6) as root, edit /etc/sudoers and add this:

Code: Select all
your_username ALL = NOPASSWD : ALL

To go to a workspace -
bind + F2, F3...

You can launch it from your .xinitrc, here's my .xinitrc:

Code: Select all

iceweasel &
setxkbmap -option terminate:ctrl_alt_bksp
setxkbmap es
xsetroot -solid black
xrdb -merge .Xdefaults
unclutter -idle 2 &
numlockx &
xmodmap .xmodmaprc

exec ratpoison


I wrote a similar howto when using vectorlinux a couple of years ago under
the username 'macondo'.

I am by no means the authority on rp (a little dense), feel free to add to this howto with the
aim of improving it. And remember, you can use the mouse.
Try it, use it for a day :)

I forgot to mention that if when reading, you want the mouse cursor to banish (by default):

Code: Select all
bind + b

It will come back when you move the mouse again :)

UPDATE: i'm sorry, I missed a line in the .ratpoisonrc:

Code: Select all
unbind k

**Notice the new entrance Focus and Exchange of frames
Apologies! :(

Debian Jessie w/o systemd - icewm
User avatar
Posts: 235
Joined: April 5th, 2011, 3:58 pm

Return to HowTo

Who is online

Users browsing this forum: No registered users and 3 guests