JWM Part 2 The Menu

Published on September 20, 2021 at 7:48 am by LEW

Introduction

In this post I start customizing the JWM menu system. Customizing the menu will help get us away from using the terminal to start programs with graphical front ends, improving the GUI experience.

Note, please take the time to review the previous post in this series. It laid some foundational work and software expectations that will be built upon here and in future posts.

GUI Tool Kits

I am going to make a rather vague all encompassing generalization here, so please do not take it as absolute truth. Many application with a GUI front end use one of two tool kits (yes I know there is more than two), either QT or GTK. I mention this because of the potential for a large number of required dependencies.

You will need to do some research on what applications you want to use. If possible, to limit the amount of software installed, choose programs that use similar dependencies. For an idea of the variety of window managers available, please check The Comprehensive List of Window Managers for Unix and Comparison of X window managers.

Install Some GUI Software

So I actually have something to put in my menu, and to make things look a little nicer I am installing a couple of additional packages. The first is the XFE package (which contains a file manager and some utility programs). I am also going to install the icons from the Tango project. To do this enter the following in a terminal as root.

apt install xfe tango-icon-theme

Launch the File Manager

From the terminal type xfe &. This will launch the XFE file manager. If you are logged in as root, you will get a warning about running as root. Just click through it. The & causes the program to be pushed to the background, freeing up the terminal for other jobs.

XFE File Manager

Let’s navigate to our JWM configuration file at /etc/jwm/system.jwmrc. Double click on it, and a box will open. In the text box type xfwrite (utility in the XFE package), then accept.

XFWrite Program

Adding to the JWM menu

We will be using two tags to add the file manager to the menu, <Menu></Menu> and <Program></Program>. The first will create a menu folder, and the second will add the actual program.

Going back to the file manager, lets navigate to /usr/share/icons/tango/32×32/apps. In this folder we can find the icon called file-manager.png. If we navigate to /usr/share/icons/tango/32×32/places, we can find a file called folder.png. We will use these two icons in our menu.

The first thing we want to do is add the paths to these icons to to the icon paths section of the system.jwmrc file.

<IconPath>/usr/share/icons/Tango/32x32/apps</IconPath>
<IconPath>/usr/share/icons/Tango/32x32/places</IconPath>

Next we want to add the new menu items to the root menu section. I will add it in right under the <include>/etc/jwm/debian-menu</include> tag.

This is an example using many of the available options for both type of tags.

<Menu label=”Utilities” icon=”folder.png” labeled=”true”>
     <Separator/>
     <Program label=”File Manager” icon=”file-manager.png” tooltip=”XFE”>
          xfe
     </Program>
</Menu>

Now save the file and use the Restart option from the menu to reload JWM. If we did everything correctly we should have a new menu folder called Utilities, containing our file manager program. Both should have icons. Incidentally the terminal program also acquired an icon (can you determine why?).

JWM Menu Item Example

In the Menu tag, we defined the following.

A separator was added to draw a line under the sub menu label.

In the Program tag, we defined the following.

Between the program tags we list the actual command to run.

Include Debian-Menu

You may be wondering about this entry; <include>/etc/jwm/debian-menu</include>.

The <include></include> tag includes an external file in the menu structure. You can find the debina-menu file in the same folder as system.jwmrc.

I usually remove it at some point and transfer the functionality I want into the main menu file. It is up to you what you do with it.

Built In Functions

You will note two entries at the bottom of the root menu, restart and exit. These are built in JWM functions. I will be covering these a little latter when I talk about installing and setting up the sudo package.

Conclusion

We have covered the basics of adding a program to the JWM menu. Now it is up to you to determine what applications you want to install, and add tot he JWM menu.

I will be posting about some of my favorite Linux applications later, but for now, to get you going you might want to install gimp and libreoffice.

Next time I will talk about changing the window color scheme.

JWM Part 1 Taking Control
JWM Part 2 The Menu
JWM Part 3 Window Color
JWM Part 4 Desktop Background
JWM Part 5 The Tray
JWM Part 6 Exiting JWM
JWM Part 7 Bindings and Groups

Add New Comment

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