JWM Guide

Installation

JWM does come in binary form, but you should check with your distribution development team for avalability and version. I recommend dowloading the source package and compiling it for your system. This will insure that you have the latest version. This will further insure that the Configuration page on the official site and these instructions will match your version. This instruction will walk through installing from source.

First we will download the source package either from http://joewing.net or from the Official Mirror. I usually download the package and then move it to /usr/src/ as that is where I place all of the source packages I install. However, this is not a requirement. If you have a particular place that you would like to put the source then do so as it makes no difference to this guide. Next the source code will need to be unpackaged and uncompressed. If you are unfamiliar with tarballs and bzip2 then use this command:

root[ jwm-1.5 ]# tar jxvf jwm-<version>.tar.bz2

NOTE: if you have place this in /usr/src/ as I do then you will need to be root, to su to root or sudo the command

Now you can change directory into the newly created jwm-<version> directory and I suggest that you run:


root[ jwm-1.5 ]# ./configure --help                     

The full command that I suggest is:

root[ jwm-1.5 ]# ./configure --bindir=/usr/bin --enable-debug

I suggest using debug only if you are interested in reporting a bug and having something more discriptive than "It didn't work". And I designate the binary to go to /usr/bin because I like to keep all my binaries there.

As long as that returns with no errors we can move onto:

root[ jwm-1.5 ]# make && make install

Again, as long as that returns with no errors (and it should if you got past the configuration) then the last thing you need to do is copy the global configuation file into your home directory like this:

root[ jwm-1.5 ]# cp /usr/local/etc/system.jwmrc /home/<your_user_name>/.jwmrc

You can now exit as root.


Post Installation

The first thing that we want to do in our post install deals with the configuration file. In your favorite text editor open ~/.jwmrc. The jwmrc is written in XML. I am not going to go too far into the aspects of the jwmrc because all the tags and the attributes to those tags are discribed on the Official Config Discription Page. I will, however, hit some of the important highlights.

RootMenu

Without this you will not have a menu which is the primary way to execute applications and restart or exit the window manager.
There are 4 attributes that fall under this tag:

Within the RootMenu you can use the following tags:

Trays

You can specify and position more than one tray around your desktop. The following attributes are recognized:

Within the Tray you can use all some or none of the following tags:

Styles

The styles control the look and feel of JWM. Things like Fonts and Colors can be designated as well as sizes of borders, look of hint popups. These Styles are used in themes but i will not go into them just now.

Icons

XPM and PNG icons are both supported. Icons are used in windows, tray buttons and the menu. Icons are not found on the desktop but a couple of distibutions have used Rox-Filer as a desktop to gain that effect. If you don't specify an icon JWM will attempt to read the _NET_WM_ICON and grab an icon for you. If no icon is found to match then a blank space is there.

Key Bindings

You can specify key combination to execute applications or to have the window manager preform some task. The key binding ability is so powerful that you don't even need to have a mouse for JWM to function. There are binding commands for root menu, window menu, vdesktop changing, window changing and many more.

Fonts and Colors

Fonts, by default will use xfont but has the ability to use true type fonts. I will not go into setting up TrueType Fonts cause every system is different and I don't want to go into that.

Colors are very versitile. Colors may either be hex triplets in RGB format (for example, #FF0000 is red) or by a name recognized by the X server.

Includes

This is one of the more important parts of the jwmrc file. But why did I leave it to last you ask? Well the reason is because it helps lead you into the next part of the guide you are now reading. One reason I think this is one of the more important parts is due to the ability to change things extremely quickly. Now don't get this confused with the include that is used within the RootMenu tags discribed above. Although they are similar they are two different things. This one allows other configuation files to be included into the main jwmrc. What does this mean? It means that you can split up the main jwmrc file as I have and create several files and just "Include" them into the jwmrc. For example:

I have a directory with 5 files in it.

Now what this did was organize my jwmrc into sections that I don't have to go hunting for. If I want to change something in my menu I just open my menu file, if i want to change or add a tray then I just open the trays file. I don't know about you but my menu can get quit extensive and scrolling down through the whole thing when I just want to change one thing in the group section or to fix a typo in the startup command is annoying. Now one thing to make sure of is that these files have to keep the beginning and ending <JWM> </JWM> tags for them to properly be read by JWM.

The other reason I think that this is a very important part of the configuration file is because, with this, themes can be created and applied. This leads into the next section of the guide.


Themes

The Package

Themes for JWM are nothing more than a configuration file that changes the look and feel of your currently running JWM configuration. A complete theme should include a theme file, a wallpaper or the theme file should designate a solid color for the background, a font file if using truetype fonts and a readme for credits and additional information. The theme file will only contain the list of style tags and a section commented out telling about the author. Here is a list of the Style tags:

The Readme should contain installation instructions as well as credits to the theme author, the wallpaper author and any other information that you feel important to add and want to pass on to the user.

To provide some continuity between themes and stability for the user on installing, themes should follow the directory structure of $HOME/.jwm/themes/.

Installing

To install a theme from BSDGeek's Themes you should first download and save the compressed package to your home directory and open it up. The package contains the .jwm/themes tree as described above. If this is your first theme installation then you will need to edit your $HOME/.jwmrc to include the theme file. Below is an example entry:

<Include>$HOME/.jwm/themes/jwm-blood-red</Include>

Make sure you enter this as the last entry/line before the closing JWM tag. Now you may be asking if you have to remove the style sections from your .jwmrc copy. The answer is no. You do not have to do anything more than add that tag. The reason is because when JWM reads the config file into the running system no matter how many times a tag is repeated, the last one is the only one that will be used. I find this extremely useful for when there is a typo or something that JWM doesn't understand it will fall back on the last good tag.

If this isn't your first theme then all you should have to do is edit the theme name.

Creation

Creation of a theme is fairly simple. As stated above in the discription of the package there are some things that are needed for a theme to be complete. The first and most important is the theme file. The theme file contains all of the color and font changes you would like to make for your theme. You can customize everything from the clock to the tray behind the clock to the window borders and even make a background for your theme but to do this you will have to make an assumption on the wallpaper setter that the user is going to have.

Suggested additions for the theme package are the README file and the font file. The README file should contain information on the theme's author, any credits that are needed like the wallpaper author or if the theme is ported from another WM, date created, any changelog entries and finally instructions on how to install your theme. The font should be the ttf font file if one was used in your theme. Other wise the end user will not get the full effect.


Example Theme

Below is an example of a theme. Please if you create a theme keep the format the same
[code]
<JWM>
        <!--
        TITLE:          Blood-Red
        AUTHOR:         Joe 'joesbox' Wiles
        Created:        11 Apr 05
        Version:        0.2.0
        Updates:        24 Apr 05
                        This is version 0.2.0 of the original since the original
                        had some flaws like the missing <JWM> tags and I also
                        threw in a new key binding into the theme that will
                        allow the user to switch the background image when a new
                        theme is included.
        JWM ver:        1.0.0
        -->

        <BorderStyle>
                <Font antialias="true">AL Old Royal-15</Font>
                <Width>5</Width>
                <Height>20</Height>
                <Foreground>Red</Foreground>
                <Background>Black</Background>
                <ActiveForeground>Black</ActiveForeground>
                <ActiveBackground>Dark Red</ActiveBackground>
        </BorderStyle>

        <ClockStyle>
                 <Outline>red</Outline>
                <Foreground>Red</Foreground>
                <Background>Black</Background>
        </ClockStyle>

        <TrayStyle>
                <Background>Dark Red</Background>
        </TrayStyle>

        <TaskListStyle>
                <Font antialias="True">AL Old Royal-15</Font>
                <Foreground>Red</Foreground>
                <Background>Black</Background>
                <ActiveForeground>black</ActiveForeground>
                <ActiveBackground>Dark Red</ActiveBackground>
        </TaskListStyle>

        <PagerStyle>
                <Outline>red</Outline>
                <Foreground>Red</Foreground>
<Background>Black</Background>
                <ActiveForeground>Dark Red</ActiveForeground>
                <ActiveBackground>Black</ActiveBackground>
        </PagerStyle>

        <PopupStyle>
                <Font antialias="True">AL Old Royal-15</Font>
                <Outline>black</Outline>
                <Foreground>red</Foreground>
                <Background>black</Background>
        </PopupStyle>

        <MenuStyle>
                <Font antialias="True">AL Old Royal-15</Font>
                <Foreground>red</Foreground>
                <Background>black</Background>
                <ActiveForeground>red</ActiveForeground>
                <ActiveBackground>#444444</ActiveBackground>
        </MenuStyle>

        <StartupCommand>
                jsetbg $HOME/.jwm/themes/debian-galaxy-5.jpg
        </StartupCommand>
</JWM>