JWM Configuration
Configuration settings for JWM v2.1.
Contents
Overview
Configuration of JWM is done by editing ".jwmrc". This file is XML making
it easy to edit, either by hand or programmatically.
The example.jwmrc gives an example configuration file which specifies
most of the options.
Before restarting JWM, it is a good idea to run "jwm -p" to make sure
the configuration file is free of errors. Otherwise you may end up without
a root menu.
Root Menu
The root menu in JWM is the primary way of starting programs. It also provides a way to restart or exit the window manager. Note that multiple root menus are possible. See the onroot attribute for more information. The outer-most tag is RootMenu. This tag supports the following attributes:
- onroot
Determine which buttons on the root window activate the menu. This is a list of integers specifying buttons. The default is 123. Multiple root menus may be used by specifying different buttons to activate them. Valid values in this list are 0 to 9. The usual mouse buttons are 1 for the left button, 2 for the middle button, 3 for the right button, and 4 and 5 for the scroll wheel. Therefore, accessing root menus that are assigned to buttons 0, 6, 7, 8, or 9 will typically require the use of a tray button or key binding. - height
The height of each menu item in pixels. 0 indicates that the largest menu item will determine the height. The default is 0. - label
The label to display at the top of the menu. The default is JWM. - labeled
Determines if a label appears at the top of the menu. Either true or false. The default is false.
Within the RootMenu tag the following tags are supported:
- Menu
This tag creates a submenu item. Any of the tags allowed within the RootMenu tag, including Menu, are allowed within this tag. The Menu tag supports the following attributes:- height
The height of each menu item in pixels. 0 indicates that the largest menu item will determine the height. The default is inherited from the parent menu. - label
The label to use for this menu. No default. - icon
The icon to use for this menu. No default. - labeled
Determines if a label appears at the top of the menu. The default is false.
- height
- Include
Include the contents of a file or the output of a program into the menu structure. The file (or program output) must start with a JWM tag containing one or more items to be contained within the menu. A file is specified by the text of the tag. If the text starts with exec: then the output of the specified executable is used. - Program
The Program tag provides a way to start external programs. The text of this tag indicates the command used to start the program. The following attributes are supported:- label
The label to display. The default is the text of the tag. - icon
The icon to use. No default.
- label
- Separator
This tag simply puts a line in the menu allowing menu divisions. No text or attributes are used. - Desktops
This tag adds a desktop menu. This is a menu with a list of desktops which can be selected to change the current desktop. The following attributes are supported:- label
The label to use for the menu. The default is Desktops. - icon
The icon to use for this menu. No default.
- label
- SendTo
Add a "send to" menu to the menu. After selecting an item from this menu, a window may be selected to send that window to the selected desktop. The following attributes are supported:- label
The label to use for the menu. The default is SendTo. - icon
The icon to use for this menu. No default.
- label
- Stick
Add stick/unstick window operation to the menu. After selecting this item, a window may be selected to toggle the sticky state of that window. The following attributes are supported:- label
The label to use for the menu. The default is Stick. - icon
The icon to use for this menu. No default.
- label
- Maximize
Add maximize window operation to the menu. After selecting this item, a window may be selected to toggle the maximized state of that window. The following attributes are supported:- label
The label to use for the menu. The default is Maximize. - icon
The icon to use for this menu. No default.
- label
- Minimize
Add minimize window operation to the menu. After selecting this item, a window may be selected to minimize that window. The following attributes are supported:- label
The label to use for the menu. The default is Minimize. - icon
The icon to use for this menu. No default.
- label
- Shade
Add shade/unshade window operation to the menu. After selecting this item, a window may be selected to toggle the shaded state of that window. The following attributes are supported:- label
The label to use for the menu. The default is Shade. - icon
The icon to use for this menu. No default.
- label
- Move
Add move window operation to the menu. After selecting this item, a window may be selected to move that window. The following attributes are supported:- label
The label to use for the menu. The default is Move. - icon
The icon to use for this menu. No default.
- label
- Resize
Add resize window operation to the menu. After selecting this item, a window may be selected to resize that window. The following attributes are supported:- label
The label to use for the menu. The default is Resize. - icon
The icon to use for this menu. No default.
- label
- Kill
Add kill window operation to the menu. After selecting this item, a window may be selected to kill that window. The following attributes are supported:- label
The label to use for the menu. The default is Kill. - icon
The icon to use for this menu. No default.
- label
- Close
Add close window operation to the menu. After selecting this item, a window may be selected to close that window. The following attributes are supported:- label
The label to use for the menu. The default is Close. - icon
The icon to use for this menu. No default.
- label
- Restart
This tag adds a menu item to restart the window manager. The following attributes are supported:- label
The label to use. The default is Restart. - icon
The icon to use. No default.
- label
- Exit
This tag adds a menu item to exit the window manager. If text is included in this tag it will be interpreted as a command to run when JWM exits. This can be used to start another window manager. The following attributes are supported:- label
The label to use. The default is Exit. - icon
The icon to use. No default. - confirm
Determine if a confirm dialog appears before exiting. The default is true. Note that confirm dialogs can be completely disabled at compile-time.
- label
Trays
One or more trays may be created via the Tray tag. This tag supports the following attributes:
- autohide
Determine if the tray hides itself when not activated. The default is false. - x
The x-coordinate of the tray. This may be negative to indicate an offset from the right of the screen. - y
The y-coordinate of the tray. This may be negative to indicate an offset from the bottom of the screen. - width
The width of the tray. 0 indicates that the tray should compute an optimal width depending on what it contains and the layout. 0 is the default. - height
The height of the tray. 0 indicates that the tray should compute an optimal height depending on what it contains and the layout. 0 is the default. - border
The width of the border. The default is 1. Valid values are between 0 and 32 inclusive. - layer
The layer of the tray. The default is 8. Valid values are between 0 and 12 inclusive. - layout
The layout of the tray. The default is horizontal. Possible values are horizontal and vertical. - halign
The horizontal alignment of the tray. The default is fixed. Possible values are fixed, left, center, and right. - valign
The vertical alignment of the tray. The default is fixed. Possible values are fixed, top, center, and bottom.
Within the Tray tag the following tags are supported:
- Clock
Add a clock to the tray. The text of this tag may specify a command to run when the clock is clicked. This tag supports the following attributes:- format
The clock format. See strftime(3) for more information. The default is %I:%M %p. - zone
The clock time zone. See tzset(3) for more information. This defaults to the local time zone. - width
The width to use. 0 indicates that the width should be determined from the tray and the font used. The default is 0. - height
The height to use. 0 indicates that the height should be determined from the tray and the font used. The default is 0.
- format
- Dock
Add a dock for system notifications. This can be used by those programs that use the _NET_SYSTEM_TRAY_Sn selection. The size of the Dock is dynamic based on the size of the tray and the number of items contained. Only one Dock is allowed per instance of JWM. - Pager
Add a pager to the tray. This tag supports the following attributes:- width
The width of the pager. 0 indicates that the width should be determined from the tray. The default is 0. - height
The height of the pager. 0 indicates that the height should be determined from the tray. The default is 0.
- width
- Swallow
Swallow a program into the tray. The text of this tag gives the command to run. This tag supports the following attributes:- name
The name of the program to swallow. This attribute is required since this is how JWM finds the program to swallow. - width
The width of the swallowed program. 0 indicates that the width should be determined from the tray and size requested from the program. The default is 0. - height
The height of the swallowed program. 0 indicates that the height should be determined from the tray and size requested from the program. The default is 0.
- name
- TaskList
Add a task list to the tray. This tag supports the following attribute:- maxwidth
The maximum width of an item in the task list. 0 indicates no maximum. The default is 0.
- maxwidth
- TrayButton
Add a button to the tray. This tag supports the following attributes:- label
A label to display. No default. - icon
An icon to display. No default. - popup
Text to display in a popup. This defaults to the label.
- exec:program
Execute program. - showdesktop
Minimize all windows on the current desktop. - root:n
Show root menu n. The default action is "root:1".
- label
Includes
Other configuration files may be included under the JWM tag via the Include tag. The text of this tag specifies the location of additional configuration file. The path may be relative to the location JWM was started or be an absolute path. The file at that location is read. The format of the configuration file is the same as the main configuration file.
Group Settings
Program groups allow one to specify options which apply to a group of programs by their name and/or class. A program group is created with the Group tag. As many program groups can be created as desired. Within the Group tag the following tags are supported.
- Name
The title of a program to match to be in this group. This field is case sensitive. A wild card, "*" may be used. If one or more Name tags is specified, at least one must be matched. - Class
The window class for a program to match to be in this group. This field is case sensitive. A wild card, "*" may be used. If one or more Class tags is specified, at least one must be matched. - Option
A option for this group. The table below lists possible options.
Option | Description |
---|---|
border | Enables the border on windows in this group. |
desktop:# | The desktop on which windows in this group will be started. |
icon:icon | The icon to be used for windows in this group. |
layer:# | The layer on which windows in this group will be started. |
maximized | Make windows in this group maximized. |
hmax | Make windows in this group maximize horizontally by default. |
vmax | Make windows in this group maximize vertically by default. |
minimized | Make windows in this group minimized. |
noborder | Disables the border for windows in this group. |
nofocus | Prevents windows in this group from grabbing the focus when mapped. |
nolist | Causes the tray to ignore windows in this group. |
notitle | Disables the title bar for windows in this group. |
pignore | Ignore program-specified initial position. |
shaded | Make windows in this group shaded. |
sticky | Make windows in this group sticky. |
opacity:# | Set the opacity for windows in this group. The value is a number between 0.0 and 1.0 inclusive. |
title | Enables the title bar for windows in this group. |
Window Style
The WindowStyle tag controls the look of window borders. Within this tag the following tags are supported.
- Font
The font used for title bars. See Fonts. - Width
The width of window borders in pixels. The default is 4, the minimum is 1, and the maximum is 32. - Height
The hight of window title bars in pixels. The default is 20, the minimum is 2, and the maximum is 64. - Active
The colors/opacity used for the active window. See Colors. Within this tag the following tags are supported.- Text
The color of text on the title bar. - Title
The color of the title bar (gradients are supported). - Opacity
The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. - Outline
The color of the window outline.
- Text
- Inactive
The colors/opacity used for inactive windows. The tags supported here are the same as those supported for Active.
Clock Style
The ClockStyle tag controls the look of clocks on the tray. Within this tag the following tags are supported:
Tray Style
The TrayStyle tag controls the look of the tray. Within this tag the following tags are supported:
- Font
The default tray font. See Fonts. - Background
The default background color. See Colors. - Foreground
The default foreground color. See Colors. - Opacity
The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this.
Task List Style
The TaskListStyle tag controls the look of task lists. This tag supports the following attribute:
- insert
This determines how new items are added to the task list. Valid options are left and right. The default is right.
Within this tag the following tags are supported:
- Font
The font used for program names. See Fonts. - Foreground
The foreground color of the task list. See Colors. - Background
The background color of the task list. Gradients are supported. See Colors. - ActiveForeground
The foreground color of an active item on the task list. See Colors. - ActiveBackground
The background color of an active item on the task list. Gradients are supported. See Colors.
Tray Button Style
The TrayButtonStyle tag controls the look of tray buttons on the tray. Within this tag, the following tags are supported.
- Font
The font used for tray button labels. Inherited from TaskListStyle by default. See Fonts. - Foreground
The foreground color for tray button labels. Inherited from TaskListStyle by default. See Colors. - Background
The background color of tray buttons. Gradients are supported. Inherited from TaskListStyle by default. See Colors. - ActiveForeground
The foreground color of pressed tray buttons. Inherited from TaskListStyle by default. See Colors. - ActiveBackground
The background color of pressed tray buttons. Gradients are supported. Inherited from TaskListStyle by default. See Colors.
Pager Style
The PagerStyle tag controls the look of pagers on the tray. Within this tag, the following tags are supported.
- Outline
The color of the outline around windows shown in the pager. See Colors. - Foreground
The color of inactive windows shown in the pager. See Colors. - Background
The background of inactive desktops shown in the pager. See Colors. - ActiveForeground
The color of active windows shown in the pager. See Colors. - ActiveBackground
The color of active desktops shown in the pager. See Colors.
Menu Style
The MenuStyle tag controls the look of menus in JWM (this includes the root menu and window menus). Within this tag the following tags are supported:
- Font
The font used on menus. See Fonts. - Foreground
The text color of inactive menu items. See Colors. - Background
The background color of inactive menu items. See Colors. - ActiveForeground
The text color of active menu items. See Colors. - ActiveBackground
Text background color of active menu items. Gradients are supported. See Colors. - Opacity
The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this.
Popup Style
The PopupStyle tag controls the look of popup windows such as those shown when the mouse sits over a task list item. This tag supports the following attributes:
- enabled
Determine if popups are enabled. Possible values are true and false. The default is true. - delay
The delay in milliseconds before popups activate. The default is 600.
Within this tag the following tags are supported:
Colors
Colors for various parts of JWM are specified within specific tags (described above). Colors may either be hex triplets in RGB format (for example, #FF0000 is red) or by a name recognized by the X server. For components that support gradients, two colors may be specified separated by a colon.
Icons
Icons for windows that don't supply an icon via the _NET_WM_ICON hint are located by searching the icon search path(s) for an icon whose name (minus the extension) matches the instance name of the window as returned in the WM_CLASS hint. If this lookup fails, a default icon is supplied. This icon will be displayed for the window on it's title bar and on the task list. Icons that are not an appropriate size will be scaled. Square icons work best.
For menu items, the icon path is searched for a match. The icon specified for a menu item must be the exact name of the icon file with extension. If no match is found, a blank area will appear where the icon should appear. If an icon is not specified for any menu item in a menu, no space will be allocated for icons.
Zero or more IconPath tags may be specified. The text of this tag is assumed to be an absolute directory path to a directory containing XPM, PNG, and/or JPEG icons. When searching for icons, if multiple paths are provided, the paths will be searched in order until a match is made. Note that icon, PNG, JPEG, and XPM support are compile-time options.
Key Bindings
Keyboard bindings in JWM are controlled by the configuration file. For example:
<JWM>
.
.
.
<Key mask="mask" key="key">action</Key>
</JWM>
Here mask specifies the modifier keys that must be held to enable this action and key specifies the key that is to be pressed. keycode may be specified instead of key if the key code is known but the key is not (or there is no symbol for the key code). action is the action performed when this combination is pressed. The mask section is optional. It can contain any number of the following values:
- A - Alt (mod1)
- C - Control
- S - Shift
- 1 - mod1
- 2 - mod2
- 3 - mod3
- 4 - mod4
- 5 - mod5
Note that physical key which determines the mask can be configured using the
"xmodmap" program.
The key section must contain a value key string for XStringToKeysym.
These values are usually what one would expect (for example, the escape
key is called "Escape").
Finally, the action is the action to be performed when a key is
pressed. Valid actions are:
Value | Description | Grabbed? |
---|---|---|
up | Key to move up. | No |
down | Key to move down. | No |
right | Key to move right. | No |
left | Key to move left. | No |
escape | Key to stop a move/resize or exit a menu. | No |
select | Key to make a selection. | No |
next | Key to move to the next window in the task list. | Yes |
nextstacked | Key to move to the next window in the stacking order. | Yes |
prev | Key to move to the previous window in the task list. | Yes |
prevstacked | Key to move to the previous window in the stacking order. | Yes |
close | Key to close a window. | Yes |
miminize | Key to minimize a window. | Yes |
maximize | Key to maximize a window. | Yes |
shade | Key to shade a window. | Yes |
move | Key to move a window. | Yes |
resize | Key to resize a window. | Yes |
root:n | Key to show root menu n. | Yes |
window | Key to show the window menu for the active window. | Yes |
desktop# | Key to switch to a specific desktop. To use this, # must be specified in the key section. Then numbers from 1 to the number of desktops configured are substituted for #. | Yes |
rdesktop | Key to move one desktop to the right. | Yes |
ldesktop | Key to move one desktop to the left. | Yes |
udesktop | Key to move up one desktop. | Yes |
ddesktop | Key to move down one desktop. | Yes |
exec:command | Key to execute command. | Yes |
restart | Key to restart JWM. | Yes |
exit | Key to exit JWM. | Yes |
The "grabbed" field indications whether or not the key for a
specific action will be intercepted by the window manager.
Note that any binding not specified in the configuration file will not
be accessible. Further, it is possible to bind multiple key combinations
to the same action.
Mouse Bindings
- Any button on the root window will bring up the root menu.
- The right button will show the window menu on the frame.
- The left button will resize if on the border or move if in the title bar.
- The middle button will move anywhere on the frame.
- A double click on the title bar of a window will toggle shading.
- The mouse wheel will move through menus when a menu is open or switch desktops when over the root or pager.
Desktops
Virtual desktops are controlled with the Desktops tag. Within this tag the following attributes are supported.
- width
The number of virtual desktops in the horizontal direction. The default is 4. - height
The number of virtual desktops in the vertical direction. The default is 1.
Within the Desktops tag the following tags are supported.
- Background
The default background for desktops. The type attribute determines the type of background and the text contained within this tag is the value. Valid types are: - Desktop
Desktop-specific data. The name attribute may be specified to name the desktop (the default is the desktop number). Within this tag, a Background tag may be specified for a desktop-specific background. See Background above for more information.
Other Settings
The following tags may also be supplied.
Tag | Description | Default | Range |
---|---|---|---|
DoubleClickDelta | The number of pixels the mouse can move during a double click | 2 | 0 - 32 |
DoubleClickSpeed | The number of milliseconds between clicks for a double click | 400 | 1 - 2000 |
FocusModel | The focus model used by JWM | sloppy | click, sloppy |
MoveMode | The move mode. The optional coordinates attribute determines the location of the move status window. Possible values are off, corner, window, and screen (the default). | opaque | opaque, outline |
ResizeMode | The resize mode. The optional coordinates attribute determines the location of the resize status window. Possible values are off, corner, window, and screen (the default). | opaque | opaque, outline |
RestartCommand | A command to run when JWM restarts. | ||
ShutdownCommand | A command to run when JWM shuts down. | ||
SnapMode | The snap mode. An optional attribute distance specifies the distance for snapping (default is 5, range 1 - 32). | border | none, screen, border |
StartupCommand | A command to run when JWM starts. |