Monday 11 March 2013

Window Maker Menus

I have noticed that contemporary Linux desktops have logical well structured application menus that are auto updated every time applications are installed or un-installed. As a devoted user of Window Maker it was a feature I have been missing. My main application menu which requires manual updating had evolved into a complete mess after 8 years of manual editing by me.

To generate the menu in a form Window Maker can display I found that the guys at Arch Linux have a perl script which does exactly that.

To get the script I downloaded the archlinux-xdg-menu package from https://www.archlinux.org/packages/community/any/archlinux-xdg-menu/download/ from Arch Linux. All I needed from the package was xdg_menu perl script. To extract the package and the file use:

tar Jxvf archlinux-xdg-menu-0.7.5.5-1-any.pkg.tar.xz

I copied xdg_menu to the bin directroy in my $HOME directoy. Then using Window Maker's WPrefs config tool I dragged the "Generated Submenu +" menu to my main menu and re-named it "Applications". In the Command field I used the following command:

/home/$USER/bin/xdg_menu --format WindowMaker --fullmenu --root-menu /etc/xdg/menus/applications.menu

Save and close WPrefs, then test the menu.

I thought I might have to modify the script to work in my Debian system but it worked with out modification, same for my Fedora desktop at work.

Note: I have only been able to get this to work in Window Maker version 0.95.4. My home desktop was 0.95.3 and I had to upgrade to the more recent version to get the generated menu to work. If you can't, or don't want to, upgrade you can use the xdg_menu script to create a menu file formatted for Window Maker which can be added using the "External Submenu +" option in WPrefs.

No comments: