JWM Agnostic X on Arch – Part 4

Published on November 8, 2022 at 9:28 am by LEW

Introduction

In this post I will begin covering the some of the configuration sections for Joe’s Window Manger (jwm). My focus will be on the various elements as needed to improve my Graphical User Interface (GUI) experience in my Virtual Machine (VM) based on Arch Linux.

Some of my priorities may differ from yours, just as my installation, use case, and even distro may also differ form yours. So I will try to be as generic as possible.

However I will try to cover the majority of available configuration options, some more useful than others. Feel free to skip around to the configuration options you are most interested in exploring.

Startup Command to Fix the Resolution

If you are using a hardware computer (not a VM), you will most likely not have any problems with the initial resolution used for the GUI. If you are using a VM, then you may find there is a resolution issue to deal with. On my virtual machine, the initial default resolution was 800 x 600, which in this day and age is pretty much unusable.

Since fixing this involves a StartupComand, I consider it a system element, I will be placing it in the system.jwm file. Please see the previous post for a discussion on breaking the configuration files down into smaller files, each with a specific focus.

For quick reference, my main local configuration file resides in the root of my home directory (~/home/user/.jwmrc). This file references several smaller configuration files located in a jwm folder within my local .config directory (~/home/user/.config/jwm).

Opening the system.jwm file I need to insert the following boilerplate. This boiler plate should go in all configuration files. So please be aware if I do not mention it again when discussing some of my other configuration files.

<?xml version=”1.0” ?>
<JWM> 
</JWM>

Within the JWM tags I am going to add a Comment and a StartupCommand tag. At this point the file should look like this.

<?xml version=”1.0” ?>

<JWM> 

<!-- Commands to be executed at Startup -->

    <StartuCommand>
        xrandr -s 1920x1080
    </StartupCommand>

</JWM>

The xrandr command is available as part of the xorg-server package under Arch. When this command is run at jwm startup with the -s (set) option, the resolution will be changed to 1920×1080.

Next we need to add the following line between the JWM tags of the main .jwmrc file.

<Include>/home/user/.config/jwm/system.jwm</Include>

Once done, you can use the Restart option from the jwm menu to apply changes. In this case, assuming no issues, we should see no difference, other than the resolution change.

The Group Tag

I consider the Group tags another system element, so they will reside inside the system.jwm file.

For the longest time I did not make use of the Group tags, mainly because I had a misconception about their purpose and how they were used. However if you are using any of the programs that are part of Xorg (like xcalc, xman or xclock for example), setting a group tag to affect how the program looks upon startup can be much easier to do and maintain than playing with xresources.

If you read the jwm configuration page, it talks about groups of programs via the name or class. This is probably where my confusion occurred. To actually do a group of programs you have to list multiple programs within the group tag.

An example is the best way to explain how this works. So lets customize the startup of xterm with a group tag. I add the following XML to the system.jwm file

<!-- Grouping Options for Programs --> 
<Group>
    <Name>xterm</Name>
    <Option>x:20</Option>
    <Option>y:20</Option>
    <Option>height:500</Option>
    <Option>width:800</Option>
    <Option>desktop:2</Option>
</Group>

Both Name and Class designations come form the WM_Class string. To find these you will need to install a program called xprop. In Arch it is a standalone package. In Debian it is part of a package called x11-utils. You run the xprop program in a terminal, and your cursor should change to a cross hair. Position this over a program window and left click.

Warning, you are going to get a whole lot of information. I usually use grep to filter the output. See the example below. This will output both the Name (first string) and Class (second string).

xprop | grep WM_Class

Back to the example. I used Name instead of Class, but either will work. There are around thirty or forty choices for the Option tag on the jwm configuration page. Most options are fairly obvious. I have not played with some of the not so obvious ones yet.

Walking through our example, I have set the position of the upper left corner of the window to be offset from the top left of the screen by 20 pixels in the X and Y directions (x:20 and y:20). I have also specified the size, in pixels, of the window (height:500 and width:800). In addition,  the widow to open on desktop:2 (assuming you have multiple desktops).

Let us assume we want to use the same parameters for opening xclock. We need to add a second Name tag to the Group. Now when we open xclock, it has the same window location and size as xterm did when we opened it.

<Group>
    <Name>xterm</Name>
    <Name>xclock</name>
    <Option>x:20</Option>
    <Option>y:20</Option>
    <Option>height:500</Option>
    <Option>width:800</Option>
    <Option>desktop:2</Option>
</Group>

One of the things Groups are good for is if you are running application from the terminal and you want them to open on another screen (multiple desktops). For instance we open our terminal on screen two. Unless there is a Group, any application opened from that terminal will be on screen two.

The Group tag can really enhance certain types of workflow. It is a quality of life tag, which you can get along without, but can enhance your personal workflow. If you use the Group tag, then how you use it will be very dependent on your setup and workflow.

Conclusion

In this post we have actually started our jwm configuration journey with a couple of simple examples.

In the next post I will be focusing specifically on the root menu. So stay tuned.

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 *