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.
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 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.
Remove command from the hook. See addhook for a list of available hooks.