Next: , Up: Windows


5.1 Manipulating Windows

The following are commands used to manipulate windows.

— Command: select n

This jumps you to window n where n is the window number as shown in the Program Bar. You can do the same trick with C-n too. To select no window, blanking the current frame, type `select -'.

— Command: select window-name

Go to a window by name. A shortcut is C-t '.

— Command: windows fmt

This displays the Program Bar which displays the windows you currently have running. The number before each window name is used to jump to that window. You can do this by typing C-t n where n is the number of the window. Note that only windows with numbers from 0 to 9 can be referenced using this keystroke. To reach windows with numbers greater than 9, use C-t ' and type the number at the prompt.

After 5 seconds the Program Bar disappears.

This command is bound to C-t w by default.

When invoked from the command-line like this,

          $ ratpoison -c windows
     

Instead of a message bar, you will get a list of the windows printed to stdout. This allows you to write more advanced scripts than simple keyboard macros. This is where fmt comes into play. If windows is given an argument it treats it as the format string as described in set winfmt.

— Command: title title

Rename the currently active window. This name will remain for the duration of the window's life, unless you change it again. By default, the C-t A keystroke is bound to this command.

— Command: other

This toggles between the current window and the last window. By default, this is bound to C-t C-t.

— Command: prev

This jumps you to the previous window in the window list. By default, this is bound to C-t p.

— Command: next

This jumps you to the next window in the window list. This one is bound to three keystrokes, namely C-t n, C-t space, and C-t enter.

— Command: kill

This destroys the current window. Normally you should only need to use delete, but just in case you need to rip the heart out of a misbehaving window this command should do the trick. Also available as C-t K.

— Command: info fmt

Display information about the current window. At optional fmt argument can be passed to override the default format. info accepts the same format options as windows.

— Command: gravity g

Change the gravity of the current window. A normal window will default to the top-left corner of the screen, but it can also be placed at the bottom-right corner of the screen. Valid values for g are the 8 directions `northwest', `north', `northeast', `east', `southeast', `south', `southwest' and `west', clockwise from the top left corner. `center' will center the window in the frame. g and can be abbreviated to the standard compass 1 and 2 letter abbreviations (i.e. `nw', `s', etc).

When called with no arguments, the current setting is returned.

— Command: delete

This deletes the current window. You can access it with the C-t k keystroke.

— Command: set infofmt fmt

Set the default window format for the info command. See set winfmt for accepted format characters.

— Command: set winname name

There are three resources ratpoison can get a window's name from: the WMNAME hint, the res_name from the WMCLASS hint, or the res_class from the WMCLASS hint. name can be `title' which is what most window managers put in the title bar, `name' which is the res_name, or `class' which is the res_class.

When called with no arguments, the current setting is returned.

— Command: set wingravity g

Set the default gravity for normal windows. See the gravity command.

When called with no arguments, the current setting is returned.

— Command: set winliststyle setting

The window list can be displayed in a row or a column. setting can be `row' or `column'.

— Command: set winfmt fmt

Set the default window format for the windows command. By default it is `%n%s%t'. The following is a list of valid format characters:

`%a'
Application Name
`%c'
Resource Class
`%f'
The frame number the window is displayed in or a space if it is not in a frame.
`%g'
The window's gravity setting
`%h'
The window's height
`%H'
The window's height increment hint.
`%i'
X11 Window ID
`%l'
A unique number based on when the window was last accessed. The higher the number, the more recently it was accessed.
`%n'
The window number
`%p'
Process ID ('?' if _NET_WM_PID isn't set)
`%s'
Window status (current window, last window, etc)
`%S'
The window's screen
`%t'
Window Name
`%T'
Whether the window is a transient or not.
`%M'
Whether the window is a maxsize window or not.
`%w'
The window's width
`%W'
The window's width increment hint
`%x'
the window's xinerama screen

Additionally there can be a number between the percent sign and the format character, denoting a maximum length this value is to truncate to, e.g. `%n%s%20t'.

When called with no arguments, the current setting is returned.

— Command: number n target

Set a window's number to n. If another window occupies the requested number already, then the windows' numbers are swapped.

The second argument, target, is optional. It should be the number of the window whose number will be changed. If target is omitted ratpoison defaults to the current window.

— Command: set transgravity g

Set the default alignment for transient windows. See the gravity command.

When called with no arguments, the current setting is returned.

— Command: set maxsizegravity g

Set the default alignment for windows with maxsize hints. See the gravity command.

When called with no arguments, the current setting is returned.

— Command: set border n

Set the border width for all windows.

When called with no arguments, the current setting is returned.