Next: , Previous: Keystrokes, Up: Top


10 Hooks

One of the goals of ratpoison is to allow users to create exciting customization to fit their specific needs. Hooks allow a user to latch scripts onto certain events.

Each hook contains a list of commands to be executed when the appropriate event occurs in ratpoison. For example, if you want to warp the rat to corner of the screen every time you press a top level bound key, you could add this to you .ratpoisonrc file:

     addhook key banish

That should keep the rat out of your way.

— Command: addhook hook command

Add a command to hook. When the hook is run, command will be executed.

The following hooks are available:

key
Run when a top level key is pressed (by default the only top level key is the prefix key).
switchwin
Run when the user switches to a different window in the current frame.
switchframe
Run when the user switches to another frame. This is also run when the user switches to a different screen, since a frame switch also occurs.
switchgroup
Run when the user switches to a different group.
switchscreen
Run when the user switches to a different screen.
deletewindow
Run when a window is deleted.
newwindow
Run after a new window is mapped.
titlechanged
Run when the current window's title changes.
quit
Run when ratpoison exits.
restart
Run when ratpoison restarts.
— Command: remhook hook command

Remove command from the hook. See addhook for a list of available hooks.

— Command: listhook hook

List the commands that will be run when hook is fired.