

5. Windows

Command: next

Go to the next window in the window list.

Command: pull-hidden-next

Pull the next hidden window into the current frame.

Command: prev

Go to the previous window in the window list.

Command: pull-hidden-previous

Pull the next hidden window into the current frame.

Command: delete-window &optional (window (current-window))

Delete a window. By default delete the current window. This is a request sent to the window. The window’s client may decide not to grant the request or may not be able to if it is unresponsive.

Command: kill-window &optional (window (current-window))

Tell X to disconnect the client that owns the specified window. Default to the current window. if delete-window didn’t work, try this.

Command: echo-windows &optional (fmt *window-format*) (group

(current-group)) (windows (group-windows group)) Display a list of managed windows. The optional argument fmt can be used to override the default window formatting.

Command: other-window &optional (group (current-group))

Switch to the window last focused.

Command: pull-hidden-other

Pull the last focused, hidden window into the current frame.

Command: renumber nt &optional (group (current-group))

Change the current window’s number to the specified number. If another window is using the number, then the windows swap numbers. Defaults to current group.

Command: meta key

Send a fake key to the current window. key is a typical StumpWM key, like C-M-o.

Command: select-window query

Switch to the first window that starts with query.

Command: select-window-by-number num &optional (group (current-group))

Find the window with the given number and focus it in its frame.

Command: title title

Override the current window’s title.

Command: windowlist &optional (fmt *window-format*)

Allow the user to Select a window from the list of windows and focus the selected window. For information of menu bindings See section Menus. The optional argument fmt can be specified to override the default window formatting.

Command: fullscreen

Toggle the fullscreen mode of the current widnow. Use this for clients with broken (non-NETWM) fullscreen implemenations, such as any program using SDL.

Command: info &optional (fmt *window-info-format*)

Display information about the current window.

Command: refresh

Refresh current window without changing its size.

Command: redisplay

Refresh current window by a pair of resizes, also make it occupy entire frame.

Variable: *window-format*

This variable decides how the window list is formatted. It is a string with the following formatting options:


Substitute the window number.


Substitute the window’s status. * means current window, + means last window, and - means any other window.


Substitute the window’s name.


Substitute the window’s class.


Substitute the window’s resource ID.


Draw a # if the window is marked.

Note, a prefix number can be used to crop the argument to a specified size. For instance, ‘%20t’ crops the window’s title to 20 characters.

Variable: *window-name-source*

This variable controls what is used for the window’s name. The default is :title.


Use the window’s title given to it by its owner.


Use the window’s resource class.


Use the window’s resource name.

Variable: *new-window-prefered-frame*



5.1 Window Marks

Windows can be marked. A marked window has a # beside it in the window list. Some commands operate only on marked windows.

Command: mark

Toggle the current window’s mark.

Command: clear-window-marks &optional (group (current-group)) (windows

(group-windows group)) Clear all marks in the current group.

Command: pull-marked

Pull all marked windows into the current frame and clear the marks.


5.2 Customizing Window Appearance

Variable: *maxsize-border-width*

The width in pixels given to the borders of windows with maxsize or ratio hints.

Variable: *transient-border-width*

The width in pixels given to the borders of transient or pop-up windows.

Variable: *normal-border-width*

The width in pixels given to the borders of regular windows.

Variable: *window-border-style*

This controls the appearance of the border around windows. valid values are:


All space within the frame not used by the window is dedicated to the border.


Only the border width as controlled by *maxsize-border-width* *normal-border-width* and *transient-border-width* is used as the border. The rest is filled with the unfocus color.


The same as :thin but the border surrounds the window and the wasted space within the frame is not obscured, revealing the background.


Like :tight but no border is ever visible.

After changing this variable you may need to call sync-all-frame-windows to see the change.

Function: set-win-bg-color color

Set the background color of the window. The background color will only be visible for windows with size increment hints such as ‘emacs’ and ‘xterm’.

Function: set-focus-color color

Set the border color for focused windows. This is only used when there is more than one frame.

Function: set-unfocus-color color

Set the border color for windows without focus. This is only used when there is more than one frame.

Function: set-normal-gravity gravity

Set the default gravity for normal windows. Possible values are :center :top :left :right :bottom :top-left :top-right :bottom-left and :bottom-right.

Function: set-maxsize-gravity gravity

Set the default gravity for maxsize windows.

Function: set-transient-gravity gravity

Set the default gravity for transient/pop-up windows.

Command: gravity gravity

Set a window’s gravity within its frame. Gravity controls where the window will appear in a frame if it is smaller that the frame. Possible values are:



5.3 Controlling Raise And Map Requests

It is sometimes handy to deny a window’s request to be focused. The following variables determine such behavior.

A map request occurs when a new or withdrawn window requests to be mapped for the first time.

A raise request occurs when a client asks the window manager to give an existing window focus.

Variable: *deny-map-request*

A list of window properties that stumpwm should deny matching windows’ requests to become mapped for the first time.

Variable: *deny-raise-request*

Exactly the same as *deny-map-request* but for raise requests.

Note that no denial message is displayed if the window is already visible.

Variable: *suppress-deny-messages*

For complete focus on the task at hand, set this to T and no raise/map denial messages will be seen.

Some examples follow.

;; Deny the firefox window from taking focus when clicked upon.
(push '(:class "gecko") stumpwm:*deny-raise-request*)

;; Deny all map requests
(setf stumpwm:*deny-map-request* t)

;; Deny transient raise requests
(push '(:transient) stumpwm:*deny-map-request*)

;; Deny the all windows in the xterm class from taking focus.
(push '(:class "Xterm") stumpwm:*deny-raise-request*)


5.4 Programming With Windows

Macro: define-window-slot attr

Create a new window attribute and corresponding get/set functions.

Function: window-send-string string &optional (window (current-window))

Send the string of characters to the current window as if they’d been typed.

Variable: *default-window-name*

The name given to a window that does not supply its own name.


5.5 Rule Based Window Placement

Macro: define-frame-preference target-group &rest frame-rules

Create a rule that matches windows and automatically places them in a specified group and frame. Each frame rule is a lambda list:

(frame-number raise lock &key create restore dump-name class instance type role title)

The frame number to send matching windows to


When non-nil, raise and focus the window in its frame


When this is nil, this rule will only match when the current group matches target-group. When non-nil, this rule matches regardless of the group and the window is sent to target-group. If lock and raise are both non-nil, then stumpwm will jump to the specified group and focus the matched window.


When non-NIL the group is created and eventually restored when the value of create is a group dump filename in *DATA-DIR*. Defaults to NIL.


When non-NIL the group is restored even if it already exists. This arg should be set to the dump filename to use for forced restore. Defaults to NIL


The window’s class must match class.


The window’s instance/resource name must match instance.


The window’s type must match type.


The window’s role must match role.


The window’s title must match title.

Function: clear-window-placement-rules

Clear all window placement rules.

Command: remember lock title

Make a generic placement rule for the current window. Might be too specific/not specific enough!

Command: forget

Forget the window placement rule that matches the current window.

Command: dump-window-placement-rules file

Dump *window-placement-rules* to FILE.

Command: restore-window-placement-rules file

Restore *window-placement-rules* from FILE.


This document was generated by David Bjergaard on November 1, 2014 using texi2html 1.82.