Next: The Status Bar, Previous: Keystrokes, Up: Top
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:
- 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.