Sei sulla pagina 1di 3

JWM Setup Guide

This is a quick guide to getting JWM installed and running. This guide is intend
ed as a high-level guide to getting started with JWM. See the JWM configuration
page for a comprehensive JWM configuration reference.
Installation
JWM is distributed in source form (available here), however, several distributio
ns make JWM available as a binary package. Note that pre-compiled versions of JW
M are often older than the newest version available here. To check the version o
f JWM, run "jwm -v" from a command line.
Assuming you are installing JWM from source, after downloading and expanding the
file, run the "configure" script.
./configure
The configure script will configure JWM for your system. By default, it will ena
ble all options provided it can find the appropriate libraries. You may need to
install the "development headers" for some libraries to compile JWM. Simply re-r
un the configure script after installing any necessary packages. If you are miss
ing a necessary library, the configure script will either fail (if the library i
s required) or tell you that some feature is disabled. JWM is installed to "/usr
/local/bin" by default. The prefix where JWM is installed ("/usr/local" by defau
lt) can be changed using the configure script if desired using the "--prefix" op
tion. Run "./configure --help" to display the available configuration options.
After successfully running configure, compile JWM by running "make". Once JWM is
compiled, you can install it by running "make install" as root ("sudo make inst
all").
Starting JWM
The preferred method for starting JWM varies depending on distribution and the d
isplay manager used to login. A common approach is to add the following line to
either "$HOME/.xsession" or "$HOME/.Xinitrc":
exec /usr/local/bin/jwm
This will typically cause JWM to load immediately when X starts (if you are not
using a login manager) or when the "user-defined" login is selected.
Configuration
JWM is configured via an XML configuration file. By default, this file is locate
d in "/usr/local/etc/system.jwmrc". To customize JWM, copy this file to "$HOME/.
jwmrc" and then modify it using your favorite text editor. Although somewhat ver
bose, XML (which looks much like HTML) provides a convenient way to represent hi
erarchical configuration, such as menus. In addition, XML fairly easy to edit ei
ther by hand or programmatically.
Some distributions divide up the JWM configuration file into multiple files. Fur
ther, at least on distribution, Puppy Linux, provides tools to modify the JWM co
nfiguration though a graphical interface.
The rest of this document will describe how the various sections of the JWM conf
iguration file work. Note that the order of the sections in the configuration fi
le is not important. However, it is possible to override settings by specifying
them multiple times, in which case the last setting will be used.
Within the JWM configuration file, the top-most "tag" must be JWM.
thing that starts with a "<" and ends with a ">". All tags must be
s means that there is either an end tag (a tag starting with "</")
or the tag is an "empty-element" tag, meaning it ends with a "/>".

A tag is the
"closed", thi
following it
All configura

tion options are nested within the JWM tag.


Root Menu Configuration
JWM can provide one or more "root" menus. These menus provide a way for one to s
tart programs. In the default configuration distributed with JWM, the root menu
can be accessed by clicking on the desktop or by clicking the "JWM" button in th
e lower-left corner of the screen. Note that you may have a different configurat
ion if you installed JWM from a binary distribution, such as through apt or yum.
The root menu in the default JWM configuration has several programs in it, but y
ou will likely want to customize this menu by adding your own programs. A root m
enu is found in the configuration file inside the RootMenu tag. For example, it
should look something like this:
<RootMenu onroot="12">
<Program icon="terminal.png" label="Terminal">xterm</Program>
<Menu icon="folder.png" label="Applications">
<Program icon="calc.png" label="Calculator">xcalc</Program>
<Program icon="web-browser.png" label="Midori">midori</Program>
<Program icon="text-editor.png" label="XEdit">xedit</Program>
</Menu>
<!-- more stuff here -->
</RootMenu>
Note that "more stuff here" is an XML comment, that is, JWM will ignore everythi
ng between "<!--" and "-->". Also note that I only included the first part of th
e menu here.
As shown, the root menu has one program (xterm) that shows up on the main part o
f the menu. The icon "attribute" sets an optional icon to show beside the menu i
tem. The label attribute sets the label to use. If no label is provided, the nam
e of the program is used directly. Finally, the text inside the "tag" (in this c
ase, "xterm") provides the program to run when the menu is clicked.
Submenus can also be created. In the example above, there is one submenu, introd
uced by the Menu tag. Like programs, submenus can have an icon and label. Within
the submenu, additional programs and submenus can be inserted.
The look of menus is controlled by the MenuStyle section. See the configuration
page for details.
Trays
The default configuration includes a "tray" at the bottom of the screen. This tr
ay has a button to display the root menu and a button show the desktop. It also
contains a pager, which shows the virtual desktops, a task list, a clock, and a
swallowed application (xload). It is possible to change the position and layout
of this tray. In addition, it is possible to create additional trays or complete
ly remove the tray. The section in the configuration file in the Tray tag define
s the default tray. To add another tray, simply add another Tray tag and set the
position as appropriate.
The look of the trays is controlled primarily by the TrayStyle section. The look
of the tray buttons can be refined using the TrayButtonStyle tag. The look of t
he pager can be refined using the PagerStyle tag. The look of the task list can
be refined using the TaskListStyle tag. Finally, the look of the clock can be re
fined using the ClockStyle tag.
Focus Model
JWM supports two focus models: click and sloppy. The default focus model is slop
py. Sloppy focus means that the window the mouse is over determines which window
has focus. Click focus means that windows behave as in Windows or Mac OS X, whe

re you must click the window to give it focus. To change the focus model, modify
the FocusModel setting.
Desktops
The number of desktops is controlled by the Desktops tag. The width attribute de
termines how many desktops are available horizontally and the height attribute d
etermines how many desktops are available vertically.
In the Desktops section it is possible to specify a background for all desktops
or each individually. Further, it is possible to set names for each desktop.
Groups
JWM allows one to customize the behavior of windows based upon their name or "cl
ass". This is controlled via "groups". You can have as many groups as you want.
Each group is introduced by the Group tag.

Potrebbero piacerti anche