A command line tool that generates XDG menus for several window managers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

236 lines
7.4 KiB

xdgmenumaker
George Vlahavas
%%mtime(%m/%d/%Y)
%!target: man
%!encoding: utf-8
= NAME =
xdgmenumaker - generate XDG menus
= SYNOPSIS =
**xdgmenumaker** [//OPTIONS//]
= DESCRIPTION =
**xdgmenumaker** is a command line tool, written in python, that
generates application menus using XDG information, by scanning
*.desktop files in all //$XDG_DATA_DIRS/applications// directories. All
applications are sorted according to the main categories as specified
by
[freedesktop.org http://standards.freedesktop.org/menu-spec/latest/apa.html]
The menu entries that are generated by **xdgmenumaker** are localised
according to the running user locale settings.
**xdgmenumaker** currently supports generating menus for //fluxbox//,
//icewm//, //pekwm// and //windowmaker//.
pyxdg and pygtk are required by **xdgmenumaker**, in addition to python 2.
= OPTIONS =
: **-f, --format**
specify the output format to use. Valid options are //fluxbox//,
//icewm//, //pekwm// and //windowmaker//. Specifying the output format is
mandatory.
: **-i, --icons**
enable support for icons in the menus. This option does not have any
effect for //windowmaker// menus.
: **-n, --no-submenu**
do not create a submenu. Instead, place the application categories menus
in the window manager's main menu. This option does not have any effect
for //windowmaker// menus.
: **--pekwm-dynamic**
create dynamic menus for pekwm. If you want to have dynamically
generated menus for pekwm you have to use this option. Do not use it if
you want to generate static menus for pekwm. Only works with //pekwm//
of course.
= GENERAL OPTIONS =
: **-h**
Prints a usage message briefly summarizing all command-line options
and exits.
= CONFIGURATION =
The terminal emulator to be used for menu entries that state that an
application must be launched inside a terminal, can be specified in a
//~/.config/xdgmenumaker.cfg// configuration file. Here's an example
specifying **rxvt** as the default terminal emulator:
```
[Terminal]
terminal = rxvt
```
If no such file is present, or if no terminal is set within the file,
xdgmenumaker will default to the one specified in the debian
alternatives system on debian and debian-like systems and to xterm in
any other case.
= USAGE =
: **Fluxbox**
To generate an application menu for Fluxbox, you can run
**xdgmenumaker** like this:
``$ xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu``
and then change your main Fluxbox menu to include this file as a
submenu. For example, add this somewhere in your //~/.fluxbox/menu// file:
``[include] (~/.fluxbox/xdg_menu)``
You can add the **xdgmenumaker** command as another item in your menu,
if you want to update it, without having to run the command manually
again:
``[exec] (Update Fluxbox Menu) (xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu)``
: **IceWM**
To generate an application menu for IceWM, run **xdgmenumaker** like this:
``$ xdgmenumaker -f icewm > ~/.icewm/appmenu``
or if you want icons in your menu:
``$ xdgmenumaker -i -f icewm > ~/.icewm/appmenu``
and you can then edit your //~/.icewm/menu// file and add this line
somewhere:
``include appmenu``
You can add the **xdgmenumaker** command as another item in your menu, if
you want to update it, without having to run the command manually again:
``prog "Update Menu" _none_ xdgmenumaker -i -f icewm > ~/.icewm/appmenu``
//NOTE:// If you don't request icons in the menu, or if an icon is not found
for a certain app, the icon name in the menu for that app is set to
"_none_". This doesn't actually set the icon for that app to none.
IceWM menu entries should always include an icon . So, by pointing it
to a non existing icon, you essentially set it to use no icon. If you
actually have an icewm icon named "_none_", that one will be used instead.
: **pekwm**
There are two ways to have an XDG menu in pekwm. The first one,
auto-updates the menu, every time the menu is called. The second one,
updates the menu only when the user wants to.
**Dynamic Menus**
Edit your //~/.pekwm/menu// file with your favourite text editor and add
a like like the following one in the location that you want the
dynamically generated menu to appear:
```
Entry = "" { Actions = "Dynamic /usr/bin/xdgmenumaker -n -i -f pekwm --pekwm-dynamic" }
```
Restart pekwm and the generated menu should appear. The menu will be
automatically generated every time you access it, so it will always be
up to date. But since xdgmenumaker will run every time you access the
menu, the menu might not appear instantly, especially if you are using
an older PC.
**Static Menus**
Run:
``$ xdgmenumaker -n -i -f pekwm > ~/.pekwm/appsmenu``
to create a file with the menu contents. Then edit your
//~/.pekwm/menu// file to include that menu, by adding a line like the
following, in the location that you want the menu to appear:
``INCLUDE = "/home/your_user_name/.pekwm/appsmenu"``
Restart pekwm and the generated menu should appear. The menu is static
and if you add/remove any applications, you will have to run the
xdgmenumaker command and restart pekwm all over again to update it. The
advantage is that there will be no delay in displaying the menu.
: **WindowMaker**
There are two ways to have an XDG menu in WindowMaker. The first one,
auto-updates the menu, every time the menu is called. The second one,
updates the menu only when the user wants to.
**xdgmenumaker** uses utf8 encoding and localised strings by default
and has been tested only with wmaker-crm>=0.95.1. No idea if utf8 works
properly with older WindowMaker versions.
**Dynamic Menus**
Open the WindowMaker preferences tool. In the //Application Menu
Definition// section, add a //Generated Submenu// in your menu, by dragging it
in. Click on the menu item you just dragged in and in the preferences
window, in //Command//, add:
``xdgmenumaker -f windowmaker``
Save and close the preferences window.
That command will be run every time you access that submenu, so the
application list in there will be always up to date. The downside is
that with running this command every time, especially if
you are on a very old PC, it might slow things down a bit. Even then it
is probably not anything considerable.
**Static Menus**
Run:
``$ xdgmenumaker -f windowmaker > ~/GNUstep/Defaults/xdg_menu``
Then open the WindowMaker preferences tool and in the //Application Menu
Definition// section, add an //External Submenu// by dragging it in your menu.
Click on the menu item you just dragged in and in the preferences
window, in //Path for Menu//, add the location of the menu file you just
created:
``~/GNUstep/Defaults/xdg_menu``
You can add the above mentioned **xdgmenumaker** command as another
item in your menu, if you want to update it, without having to run the
command manually again.
In the //Application Menu Definition// section in the WindowMaker
preferences window, add a //Run Program// item in your menu by dragging it
your menu. Click on the menu item you just dragged in and in the
preferences window, in //Program to Run//, add the **xdgmenumaker** command as
mentioned above.
The downside of this method, is that the menu contents will not be
updated when you install a new application or remove one. You will need
to run the xdgmenumaker command every time you want the menu to be
updated. The upside is that the menu will not be generated every time
you access the menu. This might be a better choice for (really) older
hardware.
= WEBSITE =
https://github.com/gapan/xdgmenumaker
= AUTHORS =
**xdgmenumaker** was written by George Vlahavas <vlahavas~at~gmail~dot~com>