launchers_to_menu_usage

launchers_to_menu

launchers_to_menu

Generate a menu configuration file for gtkMenuPlus or myGtkMenu from all, or a selection of, launchers (.desktop files) found in a directory or directories, and/or output information about those launchers.

launchers_to_menu is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.

launchers_to_menu comes with ABSOLUTELY NO WARRANTY.

See the license file COPYING distributed with launchers_to_menu for the complete license.

Generate a menu configuration file for gtkMenuPlus or myGtkMenu from all launchers (.desktop files) found in a directory or directories. Alternatively list details of all launchers found.

Long arguments are case-insensitive.

stdout if omitted; to use:

launchers_to_menu [other options] > menu_config_file.txt

Where pathN can be either a directory or a .desktop file.

If a directory, scans that directory and its subdirectories for .desktop files.

If a .desktop file, processes that file.

If any other kind of file, assumes it to be a menu_configuration_file, presumably obtained by editing an output file from a previous run of launchers_to_menu. Such a file is scanned for lines beginning with a path or with

#derived from: path

and the paths to .desktop files found used to create a new menu configuration file. The idea is to use launchers_to_menu to create a menu configuration file (probably a restricted one, using --namefilter and/or --categoryfilter; but not copying icons, therefore without the --icondirectory option; see below. That file can be edited, then submitted to launchers_to_menu with --icondirectory.

If --source omitted, the directory /usr/share/applications is assumed.

If omitted. no icons copied, and icon= entries in menu configuration file will point to icon referenced by the launcher, typically in some directory under /usr/share/

If present, launchers_to_menu will take longer to run.

Size of icon; 24 if omitted. An attempt will be made to locate icon of required size; if no item of exactly <size> is found, the nearest match will be used. If --icondirectory is specified, the icon will be saved to <size> required.

Any POSIX regex expression, compiled with the REG_EXTENDED flag, applied case-insensitively to launcher's Categories= field. If present, the regex_expression must match the Categories= field in the .desktop file for it to be added to output..

Since categories are supposed to be followed by a semicolon, to match e.g. "video" or "audio" but not "audiovideo" use (^|;)video($|;)|(^|;)audio($|;).

Any POSIX regex expression, compiled with the REG_EXTENDED flag, applied case-insensitively to launcher's Name= field. If present, the regex_expression must match the Name= field in the .desktop file for it to be added to output..

If present, a launcher is added to generated menu match if either --namefilter or --categoryfilter is satisfied; otherwise, both have to be satisifed for a launcher to be included.

Make menu configuration file appropriate for myGtkMenu; mainly comments out tooltip= lines

Suppresses error messages sent to STDERR, if you just want a clean list of menu entries in a console, uncluttered with error messages.

Programme version; all other options ignored

Show options; all other options ignored

Generate a menu and copy icons from every .desktop file found in directory /usr/share/applications and /usr/local/share/applications and there subdirectories:

launchers_to_menu --output ./menu_from_launchers.txt --source /usr/share/applications,/usr/local/share/applications --icondirectory icons_from_launchers --iconsize 24

The problem with that is you'll end up with hundred on menu entries and hundred of icons. It would probably better to generate a subset of available icons, filtering with --categoryfilter and/or --namefilter, but not copying icons:

launchers_to_menu --output ./tmp_menu_from_launchers.txt --source /usr/share/applications --iconsize 24 --categoryfilter Video

Then edit ./tmp_menu_from_launchers.txt and run launchers_to_menu to get icons for the remaining menu entries:

launchers_to_menu --output ./menu_from_launchers.txt --source tmp_menu_from_launchers.txt

If you want to use the generated menu configuration file with myGtkMenu, add the --mygtkmenu flag.

myGtkMenu, written and copyright by John Vorthman.

https://sites.google.com/site/jvinla/home

No known bugs.

Thanks to John Vorthman for providing myGtkMenu code.

Idea of importing .desktop files borrowed from popdown, http://www.manatlan.com/page/popdown

This programme is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.

See license.txt distributed with launchers_to_menu for the complete license.

from:

https://sites.google.com/site/entropyreduction/

Alan Campbell