# HOWTO: Ratpoison basic configuration



## macondo (Nov 26, 2021)

HOWTO: Basic Ratpoison Configuration

This is a basic configuration, I haven't learned all the tricks to it but i do
know what works for me smile.

Ratpoison (rp) is not for everybody, eye-candy, icons, title/taskbar are absent. It's
all business, uses every pixel of space and uses 1 MB of RAM. Apps are maximized
by default. If you spend time comparing desktops with your buddies to see which is
prettier, stop reading, this is not for you.

Gamers, devs, and all sort of miscreants love rp.

#pkg ins -y  ratpoison  dmenu

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

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. If you google you'll find tons
of material on '.ratpoisonrc' or 'ratpoison configuration'.

Other examples of bind keys are: C-z, C-a, C-d ...etc

I found this article by Dion Moult which explains how to change the bind key to
the Caps Lock (the key next to your left pinky finger). It's a very good
article, you should read it. It explains how to make the Caps Lock key your bind
key.

http://thinkmoult.com/ratpoison-an-effi … malist-wm/

IMHO, the easiest way to configure rp is from another wm/DE you're using at the moment.

Create the file .xmodmaprc in your /home:


```
$ touch .xmodmaprc
```

Once created, enter it with favorite editor:


```
$ nano .xmodmaprc
```

And paste this:


```
remove lock = Caps_Lock
keycode 66 = F13
```

Put xmodmaprc in your .xinitrc:

$ nano .xinitrc

Paste this:


```
xmodmap .xmodmaprc
```

CONFIGURATION FILE
It's called .ratpoisonrc, so you create it:


```
$ touch .ratpoisonrc
```

Then you enter it:


```
$ nano .ratpoisonrc
```

You'll notice is blank, then paste and post something like this:
Here's my .ratpoisonrc:


```
alias term exec lxterminal (put your favorite terminal)
escape F13
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 exchangeright

exec /usr/bin/rpws init 2 -k
exec rpws 1
exec /usr/bin/rpws init 6 -k
bind F1 exec rpws 1
bind F2 exec rpws 2

exec xsetroot -solid black -cursor_name left_ptr
bind semicolon colon
set winname class
set fgcolor yellow
set bgcolor black
set bargravity center
defborder 0
defpadding 0 0 0 0
defbarpadding 0 0

definekey top M-Tab next
bind space exec lxterminal
bind x exec xfe
bind f exec firefox
definekey top F4 kill
bind v exec viewnior    
bind h exec hexchat
definekey top Print exec lxterminal -e scrot -cd 10 


#volume
definekey top C-Down exec amixer -q set Master 2- unmute  #decrease volume                  
definekey top C-Up exec amixer -q set Master 2+ unmute #increase volume

bind d exec dmenu_run
bind r restart
bind w windows
bind Escape abort
bind q only
bind b banish
rudeness 12

#Run box (sudo and apps launching)
bind u exec

save/exit/reboot
```

--
HOW DOES IT WORK?

To launch a terminal: press bind key (caps lock) a white small square will
appear and then press the space bar, and the xterm (or whatever terminal you
specify in .ratpoisonrc) will appear.  Ditto for all the other apps.

You want to abort in the middle of an operation? Bind key + Escape.
Close an app? F4
Want to know what windows you got open? bind + w
Want to go to one of them? bind + the window #
Want to launch dmenu? bind + d
After every change 'restart rp' with: bind + r
What time/date is it? bind + a
Snapshot? press the key Print.
You miss fbrun? bind key + u
If you want to split the screen horizontally: bind + s
Vertically? Bind + S
Go back to normal? Bind + q
alt-tab as usual OR tap the bind key twice

LAUNCHING RP
You can launch rp from your .xinitrc, here is mine:


```
#!/bin/sh

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

exec ratpoison
```

save/exit/reboot

Play with it, it's addictive.
Happy trails,
macondo


----------

