JWM Agnostic X on Arch – Part 8

Published on November 15, 2022 at 8:36 pm by LEW

Introduction

In this post I will be covering some miscellaneous topics for JWM. Subjects like Colors and Fonts will not have any direct application, but become important when we start discussing styles.

We will first look at Desktops, and Bindings (mouse and keyboard), as they have direct configuration application. After which we will discuss Colors and Fonts as a prelude to talking about styling the various components in JWM.

Desktops

Like other Linux Graphical User Interfaces (GUI), JWM support virtual Work spaces, referred to as desktops. These Virtual Desktops are controlled by the <Desktops></Desktops> tag. Within the Desktops tag there can be multiple <Desktop></Desktop> tag (Desktop is not plural as opposed to Desktops) for each defined desktop.

Within both the Desktops and Desktop tag a Background tag can be defined. This tag has the options of solid (color), gradient (between two colors), image (stretched), scaled (image scaled), tile (tiled images), and command (run a program to set the background).

You can define a default background in the Desktops tag, and the definition becomes the default for all desktops, unless a different background is defined by the individual Desktop tag

Note that a Background tag within a Desktop tag takes precedence over a Background tag within a Desktops tag.

If we are not totally confused yet, lets try an example.

<Desktops width=”4” height=”1”>

    <Background type=”solid”>#111111</Background>

    <Desktop name=”Main”>
        <Background type=”solid”>#222266</Background>
    </Desktop>

    <Desktop name=”Terminal”>
        <Background type=”solid”>#662222</Background>
    </Desktop>

    <Desktop name=”Reference”>
        <Background type=”solid”>#226622</Background>
    </Desktop>

    <Desktop name=”Working”></Desktop>

</Desktops>

 

We have defined four Virtual Desktops (width x height). Note that other than number of desktops, width and height affect how the desktops will be displayed in the tray pager. We have also defined a dark gray, almost black background.

Within he Desktops tab we have defined four Desktop tags, each with its own name. If no name is supplied then the Desktop will receive a number, starting with “1” as a name. Additionally three of the desktops have there own backgrounds defined. The last one, with no background of its own, will get the default background.

Key Bindings

In JWM you can bind keys, along with modifiers to perform specific functions. Key Bindings are done with the <Key></Key> tags. A binding can have two elements, a mask (S for Shift, C for Control, or A for Alt) keys being pressed at the same time, and a key value for the actual key being pressed. The action to be performed goes in between the Key tags.

Besides using the exec: and root:n (we have talked about both of these already), there are around thirty eight additional options listed on the JWM page. One could actually run an instance of JWM with very little reliance on the mouse. It depends on how far one wants to go with the key bindings.

One thing I noticed, most of the non masked key bindings in the JWM configuration file have not been necessary, as they are defined elsewhere. On the two installations I am testing, I deleted them all. If you have a non standard keyboard, then they could be needed. Comment them out, restart JWM and see if the functionality is still there. If so, you can probably delete them without issue.

Below are some examples of the masked key bindings I use. Like a lot of things this is going to be a mater of personal preference.

<Key mask=”A” key=”Right”>rdesktop</Key>
<Key mask=”A” key=”Left”>ldesktop</Key>

Since I have my virtual desktops laid out in a line (4×1) these keybindings allow me to Alt arrow left or Alt arrow right to switch between desktops. There is also a udesktop and ddesktop if you use a stacked configuration (like 2×2).

<Key mask=”A” key=”Tab”>next</Key>
<Key mask=”C” key=”Tab”>prev</Key>

This pair of key bindings use Control and Alt plus the Tab key to shift forwards or backwards through open windows on the current virtual desk top.

Mouse Bindings

Our initial discussion of Mouse Bindings is related to both root:n (trigger used in various places to specify a rootmenu to use) and onroot:n (determines what event will triggers a specific rootmenu). Below are a few details to keep in mind when configuring mouse bindings.

JWM Mouse Bindings

Lets run through a couple of examples.

<Mouse context=”close” button=”-1”>close</Mouse>

In this example; when hovering over a window close button, and the left mouse button is released (-1) then the window will close.

<Mouse context=”root” button=”4”>ldesktop</Mouse>
<Mouse context=”root” button=”5”>rdesktop</Mouse>

In this example, when the pointer is over the root window (empty spot on desktop), and the scroll wheel (4) is turned forward, we advance to the next desktop. When the scroll wheel is turned back, we move backwards between desktops.

Colors

We now turn to colors. There are three types of color notations that the JWM configuration file recognizes.

The RGB acronym stands for Red Green Blue. This is applicable to both the 3 digit and 6 digit methods.

All uses of color in the JWM configuration file will fall into one of these three methods. Which one you use is a personal choice. You can also mix and match naming conventions. X11 color names give you the least choice of color, but are more human readable. It is much easier to recognize the name Yellow than either #ffff00 or #ff0.

I personally tend to use 3 hex digit color names. I need a bit more variety than provided by X11 color names, and six hex digit color codes is a little to granular for me. Besides 3 hex digit color codes are less typing.

Colors are used within various style element tags like; Foreground, Background. These are sub tags for various style elements like; WindowStyle, PagerStyle, TrayStyle. We will be talking about styles in the next post.

There is a additional color option that not all tags support, and that is a gradient. For those elements that support it, a gradient is expressed by two colors separated by a colon. For example.

<Background>#22a:#a22</Background>

Fonts

Like colors fonts are mainly used in the styling of various objects on the JWM desktop, which we will be covering in the next post.

JWM can support a variety of fonts. However, I am not going to talk about the older X11 bit-mapped fonts as they are rarely used. If you plan on using them, then you will want to install a program like xfontsel, that can generate the rather complicated definitions you will need to use them.

XTF fonts (like true type) are what you will want to be using for best appearance. Plus they are so much easier to define. Lets run though a few examples.

<Font>Sans-12</Font>

The above would use the system default Sans font at 12 point size. If we want to get a little more specific we can do this.

<Font>DejaVuSerif-14:bold:italic</Font>

In this example we have chosen the font family DejaVu, the Serif version, 14 point size, italic and bold.

There is a program called Font-Manager that can be used to visualize XTF fonts.

Note, that it should go without saying to use a font it needs to be loaded onto your system. And if you just loaded a new font, the font cache needs to be regenerated. The simplest way to do this is to restart your system.

Conclusion

We have covered most of the things we will need in this and pr3evious posts. With most all the tools in place we will start discussing styling the various elements of JWM in the next post.

JWM Agnostic X on Arch – Part 1 – The Install

JWM Agnostic X on Arch – Part 2 – Adding Some Applications

JWM Agnostic X on Arch – Part 3 – Initial Setup for Config File

JWM Agnostic X on Arch – Part 4 – StartupCommand and Group

JWM Agnostic X on Arch – Part 5 – Building a Menu Structure

JWM Agnostic X on Arch – Part 6 – Tray Attributes

JWM Agnostic X on Arch – Part 7 – Tray Content

JWM Agnostic X on Arch – Part 8 – Desktops, Bindings, Colors, and Fonts

JWM Agnostic X on Arch – Part 9 – Styling of Major Elements

JWM Agnostic X on Arch – Part 10 – Some more Styling

JWM Agnostic X on Arch – Part 11 – Additional functionality

Add New Comment

Your email address will not be published. Required fields are marked *