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:

Run when a top level key is pressed (by default the only top level key is the prefix key).
Run when the user switches to a different window in the current frame.
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.
Run when the user switches to a different group.
Run when the user switches to a different screen.
Run when a window is deleted.
Run after a new window is mapped.
Run when the current window's title changes.
Run when ratpoison exits.
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.