Configuration Examples

Twm configuration
Fvwm configuration
Freedesktop configuration
Pipe-Read configuration
Other configuration samples


 Twm configuration

Edit the Twm configuration file "$HOME/.twmrc" and find the line that opens the menu.
Example:

menu "defops"
{
 "Startmenu" f.title
 "Mc" f.exec "xterm -t Mc -e mc &"
 "Shell" f.exec "xterm &"
 "" f.nop
 "Show Iconmgr" f.showiconmgr
 "Hide Iconmgr" f.hideiconmgr
 "" f.nop
 "Restart" f.restart
 "Exit" f.quit
}

Now - add the following line:

"Wmconfig" f.menu "Wmconfig"

Rename the twmrc file into something like ".new_twmrc" and - instead of running twm directly, use the following script:

cp $HOME/.new_twmrc $HOME/.twmrc
wmconfig --output twm >> $HOME/.twmrc
twm

When Twm starts, it uses the Wmconfig generated menus. If you use this configuration, remember to edit the ".new_twmrc" file if you want to change something.
Use this configuration style for Twm, Mwm and Ctwm.

Back to top
 Fvwm configuration

Edit the configuration file "$HOME/.fvwmrc" and find the line with the root menu. Now - split the file into two files, the first file ends above the root menu and the second file begins with the root menu definition. Rename the files into ".fvwmrc_1" and ".fvwmrc_2".
Sample:

Popup "Startmenu"
 Title "Startmenu"
 Exec "Shell" exec xterm &
 Nop ""
 Popup "Modules" Module-Popup
 Nop ""
 Popup "Exit Fvwm" Quit-Verify
EndPopup

Now - use this script for running Fvwm:

cp $HOME/.fvwmrc_1 $HOME/.fvwmrc
wmconfig --output fvwm >> $HOME/.fvwmrc
cat $HOME/.fvwmrc_2 >> $HOME/.fvwmrc
fvwm

This works for Fvwm and Mlvwm.

Back to top
 Freedesktop configuration

The Freedesktop output should support XDG compatible desktop environments like Gnome, XFCE, LXDE or KDE. The Wmconfig output is split into 2 different parts. The first one places the menu configuration file, the second one creates the specific application launchers.
The menu file is created at "$HOME/.config/menus/applications-merged/" and named wmconfig.menu by default. This file is read by the Gnome panel as example and parsed. It includes the instructions on how the Wmconfig menu is structured and where the application launchers are placed.
The application launchers are created in the "$HOME/.local/share/applications"
If the files are created but there's still no menu shown, try creating the generic output. Also some distributions of Gnome or LXDE are patched (e.g. FreeBSD's gnome-menus package) so this may cause problems.

Note for KDE: It seems that KDE doesn't read the Wmconfig menu file from "$HOME/.config/menus/applications-merged" and uses "$HOME/.config/menus" instead. To work-around you may create a file (if it doesn't exist already) named "applications-kmenuedit.menu". This file is also used when using the KDE Menu Editor so it may exist already. If the file doesn't exist, create it with the following content:

<!DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
 'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
<Menu>
 <MergeFile>wmconfig.menu </Menu>
</Menu>

If the file exists already, maybe by using the KDE menu editor, adding the last 3 lines to the file should let KDE read the Wmconfig menu definition.

It may be required to create a link from ".config/menus/applications-merged" to ".config/menus".

Some desktop enviromment (like Mate, E17) may ignore $quot;.config/menus/applications-merged" and so not shown the Wmconfig menu. If that is the case you may specify the "outputdir" option to tell Wmconfig where the menu configuration file should be created. To get the correct location look how the system-wide menus are named. An example for Cinnamon:

ls /etc/xdg/menus

if there is a file like: cinnamon-applications.menu

wmconfig --output freedesktop --outputdir ~/.config/menus/cinnamon-merged

will create the Wmconfig menu configuration file at the right place. Basically look how the system-wide menu configuration is named, strip the "name" part and create it. The scheme is like:

/etc/xdg/menus/<name_of_the_desktop_environment&qt;-applications.menu

Then the outputdir is:

~/.config/menus/<name_of_the_desktop_environment&qt;-merged

If you want to skip the "outputdir" option you may create symlinks from Wmconfig's default location, which is "~/.config/menus/applications-merged". As example symlinks to enlightenment-merged, kde4-merged, gnome-merged, mate-merged allow you to use the Wmconfig menu, when run with the "freedesktop" output, under several desktop environments.

Back to top
 Pipe-Read configuration

Other window managers like WindowMaker, Pekwm or Golem support external submenus using special Pipe-Read commands. A command like a Shellscript or Wmconfig then generates the menus.
For WindowMaker add a line like:

(Applications, OPEN_MENU, "|| wmconfig --output wmaker"),

to the menu configuration file ("WMRootMenu")

OpenBox also support such a configuration. Just add in your "menu.xml" file the following lines:

<menu id="wmconfig" label="Wmconfig" execute="wmconfig --output openbox"></menu>

And then in the Root Menu definition called "root-menu" the lines:

<menu id="wmconfig" />

This configuration may not work when using the LXDE configuration of Openbox.

PekWm also supports Pipe Menus. Just add the following line:

COMMAND = "wmconfig --output pekwm"

in your menu file.

Golem also uses a similar function and this line should read the menus:

.exec "/usr/local/bin/wmconfig --output golem"

For Fvwm2 and Fvwm95 add the lines the following lines:

AddToMenu "Wmconfig" "Wmconfig" Title
 + DynamicPopupAction Function Wmconfig_Menu

AddToFunc Wmconfig_Menu  + I DestroyMenu recreate Wmconfig
 + I AddToMenu Wmconfig "Wmconfig" Title
 + I PipeRead 'wmconfig --output fvwm2'

to the configuration file and paste the line:

+ "Wmconfig" Popup Wmconfig

into the root menu definition.

For JWM the following configuration may be used when added to the RootMenu definition:

 <Menu icon="folder.png" label="Wmconfig">
  <Include>exec:wmconfig --output jwm</Include>
 </Menu>

This will include the Wmconfig output into a submenu inside the root menu.

Back to top
 Other configuration samples

The given examples may be easily used for other window managers like Qvwm or Ol(v)wm. Refer the manuals on how to include external menus into the configuration or feel free to write me an Email.

Back to top