fvwm-menu-desktop(1)
π fvwm-menu-desktop(1) π
hiii bestie π«Ά welcome to the manual page for fvwm-menu-desktop, a proud member of the Fvwm Modules family. this is part 1 of 2, so don't go anywhere, there's more coming β¨
π NAME π
fvwm-menu-desktop β reads XDG menu files and creates Fvwm menus. that's the whole job description and she does it flawlessly π
π SYNOPSIS π
fvwm-menu-desktop [ --help|-h ] [ --version ] [ --install-prefix DIR ] [
--desktop NAME ] [ --menu-type NAME ] [ --theme NAME ] [
--with-titles|-w ] [ --without-titles ] [ --enable-mini-icons ] [
--size|-s NUM ] [ --mini-icon-dir DIR ] [ --app-icon NAME ] [ --dir-icon
NAME ] [ --title|-t NAME ] [ --insert-in-menu NAME ] [ --get-menus
all|desktop ] [ --set-menus menu_paths ] [ --all-menus ] [
--include-items NAME ] [ --regen-cmd CMD ] [ --term-cmd CMD ] [
--dynamic ] [ --menu-error|-e ] [ --verbose|-v ]
π¦ DESCRIPTION π¦
okay so. this is a python script π
that parses your XDG menu definitions and builds the matching fvwm menus out of them. and listen β she depends on python-xdg to run, so if that isn't on your system she literally cannot function, no cap π
β¨ OPTIONS β¨
π Main Options π
--helpβ shows the help and then exits. she's done, she's leaving, bye π--versionβ shows the version and exits. quick little flex β¨--get-menus all|desktopβ prints a space separated list of the full menu paths she found on your system.all= every menu found on the system except the empty ones.desktop= the menu(s) that would be generated by the script. and bestie, no menu generation is done here at all, she's just showing you the receipts π₯--desktop NAMEβ optional, sets theNAMEof the desktop XDG.menufile(s) to use. this one overrides any default menus you set throughFvwmForm-XDGMenu-Config, and makes the script hunt for menus whereNAMEis part of the file name. possible names:gnome,kde,xfce,lxde,debian, etc. you can run this together with--menu-typeto control which.menufile(s) get used. it's a duo, not a solo π«Ά--menu-type NAMEβ optional, sets theNAMEof the XDG menu type to use. this overrides any default menus set viaFvwmForm-XDGMenu-Configand makes the script look for menus whereNAMEis part of the file name. possibleNAMEtypes could be:applications,settings,preferences, etc. when you pair it with--desktop, only menus whose file name matches'*destkop*menutype*'are found. and if no menus are found, the script exits with an error. not a vibe but okay π--all-menusβ builds all the menus found on the system. pair it with--desktopor--menu-typeand she'll build every menu matching those settings. she's doing the MOST π--install-prefix DIRβ optional, overrides the standard locations for XDG menu definitions. tellsfvwm-menu-desktopto look inDIRfor.menufiles instead of the usual spots,/etc/xdg/menus(and$HOME/.config/menusif it exists).--with-titles|-wβ if this is set, menus get generated with titles. this is the default. use it to override theFvwmForm-XDGMenu-Configdefault setting.--without-titlesβ if this is set, menus get generated without titles. the default is to generate with titles. so this is the "actually, no" button.--title|-t NAMEβ defines the menu titleNAMEof the top menu, the one used by Fvwm'sMenuorPopupcommands. default is"XDGMenu".--include-items NAMEβ controls whether the extra menu items'Regenerate'and'Configure'get included in the top level menu.NAMEcan be one ofregenerate,config,both, ornone. default isboth.--regen-cmd CMDβ sets the fvwm commandCMDthat runs when the menu item'Regenerate'is selected. default isPipeRead `fvwm-menu-desktop`.--term-cmd CMDβ sets the terminal emulator commandCMDused to run terminal applications in.CMDneeds to end with an execute option, such as xterm's-eoption, which will run the command that gets appended toCMD. default is"xterm -e".--dynamicβ for creating dynamic menus withDynamicPopUpActionandDynamicPopDownAction. this adds a'recreate'to theDestroyMenucommand on the top level menu, so those actions don't getDestroyedwhen the menu is regenerated. protective queen π--insert-in-menu NAMEβ inserts the generated menu(s) in a menuNAME(its top title). this makes it so the top level menu isn'tDestroyedand the items get added to the end.
β οΈ heads up bestie: menus regenerated with this option will append the menu items at the end of the existing menu. every single time the menu is regenerated, new menu items show up, giving you a growing menu of duplicate items π you have to regenerate the whole menu via a function or restart fvwm. see EXAMPLES below for some solutions.
--set-menus menu_pathsβ generates all the menus listed in a space separated list of full menu paths. this option overrides any defaults and any--desktop|--menu-typesettings.--menu-error |-tβ if this option is present andpython-xdgis not found, the script prints the error in the generated menu. used in the default-config.--verboseβ enables additional information printouts onSTDERR. she's telling you everything, oversharing era π
π¦ Icons Options π¦
by default, fvwm-menu-desktop builds menus without mini-icons. to turn mini-icons on, use the following options π
if ImageMagick is installed on the system, the script will resize and copy the icons to $FVWM_USERDIR/.icons. and bestie, this can take awhile π you should be prepared to wait the first time you generate the icons. once the icons have been generated the script should run faster. if it's still too slow using icons, check EXAMPLES for ways to limit how often the menu is generated to speed things up.
--enable-mini-iconsβ enables mini-icons in the menus. if set,24x24mini-icons are used. if the specified icon isn't that size it'll be converted (if ImageMagick is installed) and saved in$HOME/.fvwm/iconsor to the directory specified with the--mini-icon-diroption. otherwise no icon appears in the menu for that entry. with most distributions, all the menu entries will have mini-icons appropriate to the application β¨--theme NAMEβ defines the used icon theme. default isgnome, but all the others found in/usr/share/iconscould be used β except thehicolortheme, because it's the default fallback theme if no icon is found. don't fight her on this one π--size|-s NUMβ if--enable-mini-iconsis used, the size of the icons can be changed with this parameter. default is24.--mini-icon-dir DIRβ when the right size mini-icon isn't available,fvwm-menu-desktopcreates icons with the right size in$HOME/.fvwm/icons. if you don't want to use the default directory,$HOME/.fvwm/icons, use this option to specify a different folder.--app-icon NAMEβ sets the default application icon if no others are found. default is'gnome-applications'.--dir-icon NAMEβ sets the default directory icon if no others are found. default is'gnome-fs-directory'.
π USAGE π
fvwm-menu-desktop outputs XDG .menu files in the syntax of fvwm menus. when you run it with no options, it loads the defaults from the FvwmForm-XDGMenu-Config file (see below), then searches your system for suitable menu file(s). to see which menus are available on your system, run:
fvwm-menu-desktop --get-menus all
if no menus are found you may not have any installed on your system π₯² by default menus are stored as *.menu files in /etc/xdg/menus, $HOME/.config/menus or the location set in $XDG_MENU_PREFIX. you can use --install-prefix to specify another location to search for menus.
through a combination of command line options and the FvwmForm-XDGMenu-Config settings, fvwm-menu-desktop can generate any combination of the menus found. to get a list of what menu(s) would be generated, use the --get-menus desktop option. the following will list all menus generated if fvwm-menu-desktop was run with no options:
fvwm-menu-desktop --get-menus desktop
fvwm-menu-desktop determines which menu(s) to generate like this:
- if no config file is found, all menus will be weighted and the script will generate the best (highest weight) menu found. main character selection process β¨
- if a config file is found (and override options are not used), the script will generate all menus selected in
FvwmForm-XDGMenu-Config. --desktop,--menu-type,--set-menusand--all-menuswill override any menus selected inFvwmForm-XDGMenu-Config.--desktopand--menu-typewill only include menus whose name matches'*desktop*menutype*'. if used with--all-menus, all matching menus are generated. if used without--all-menus, only the highest weighted menu is generated.--set-menusgenerates menus from the list of full path menu file names.--all-menusby itself will generate all menus found.
by default fvwm-menu-desktop will generate a menu whose top level name is "XDGMenu". to tell fvwm to read the output of fvwm-menu-desktop to create the menu XDGMenu, add the following to your fvwm config file:
PipeRead 'fvwm-menu-desktop'
β οΈ Warning: depending on the options used, this command may be slow and fvwm will pause until this command is complete. see EXAMPLES below for more details and possible workarounds.
once the menu is generated you can open the menu by using the command "Menu XDGMenu". you can also include this in the MenuFvwmRoot menu by:
AddToMenu MenuFvwmRoot "XDG Menu" Popup XDGMenu
fvwm-menu-desktop can be configured through both command line options and a FvwmForm GUI to customize the menu(s) that get generated. π
πΈ GUI πΈ
FvwmForm-XDGMenu-Config is a FvwmForm interface that can be used to configure the defaults for fvwm-menu-desktop. you can access this from the "Configure" item in the top level menu that is generated, or run the following from within FvwmConsole:
Module FvwmPerl -l fvwm-menu-desktop-config.fpl
this form can be used to select which menu(s) get generated by default, along with setting many (but not all) of the available options. when you click "Save Settings", the form will write a config file located at $FVWM_USERDIR/.FvwmForm-XDGMenu-Config that fvwm-menu-desktop will parse for defaults when it runs.
see the help inside of FvwmForm-XDGMenu-Config for more information π«Ά
β¨ EXAMPLES β¨
Okay bestie, this is the part where it all comes together π There are so many ways to set things up when fvwm runs fvwm-menu-desktop to generate the menu. Let's go through them, no cap.
One method is just to generate the menu when fvwm loads, and then use the GUI config tool to change any options you want. To do that, all you need is to add the following to the fvwm config file:
AddToMenu MenuFvwmRoot "XDG Menu" Popup XDGMenu
PipeRead 'fvwm-menu-desktop'
The menu is created once when fvwm loads. And since menu creation can sometimes be slow, ngl this could cause fvwm to take longer to load than one wants π
Also the menu is only generated when fvwm starts. So if software is installed or removed, you will have to select the Regenerate option to rebuild the menu. Periodt.
One way to speed things up is to save the menu in a file and only generate the menu when Regenerate is selected. To do that, use --regen-cmd to call a custom function and write the menu to a file using a command like
fvwm-menu-desktop --regen-cmd XDGRegen > $FVWM_USERDIR/.XDGMenu
Then add the following to the fvwm config file to define the function XDGRegen. The second to last line will generate the menu if the menu file doesn't exist when fvwm starts.
DestroyFunc XDGRegen
AddToFunc XDGRegen
+ I PipeRead 'fvwm-menu-desktop --regen-cmd XDGRegen > \
$[FVWM_USERDIR]/.XDGMenu; echo "Nop"'
+ I Read $[FVWM_USERDIR]/.XDGMenu
Test (!f $[FVWM_USERDIR]/.XDGMenu) XDGRegen
Read $[FVWM_USERDIR]/.XDGMenu
Besides creating a top level menu, fvwm-menu-desktop can insert the menu into an existing menu using the --insert-in-menu option π«Ά For example, one could create the menu MenuFvwmRoot and include the XDG items at the end.
DestroyMenu MenuFvwmRoot
AddToMenu MenuFvwmRoot "Fvwm" Title
+ "Item1" Action1
...
+ "ItemN" ActionN
+ "" Nop
PipeRead 'fvwm-menu-desktop --insert-in-menu MenuFvwmRoot'
In this case the menu items are inserted at the end of the MenuFvwmRoot menu. If no items are in the menu, this menu becomes MenuFvwmRoot. The problem here is that you have to restart fvwm or rebuild the whole menu to Regenerate it, because menu items cannot be removed π To do that you could use a function like
DestroyFunc XDGRegen
AddToFunc XDGRegen
+ I DestroyMenu MenuFvwmRoot
+ I AddToMenu MenuFvwmRoot "Fvwm" Title
+ I AddToMenu MenuFvwmRoot "Item1" Action1
...
+ I AddToMenu MenuFvwmRoot "ItemN" ActionN
+ I AddToMenu MenuFvwmRoot "" Nop
+ I PipeRead 'fvwm-menu-desktop --insert-in-menu MenuFvwmRoot \
--regen-cmd XDGRegen'
Fvwm can also create menus dynamically by using DynamicPopUpAction and/or DynamicPopDownAction. These commands, when used with a Menu, will run a Function when the menu is opened. For example, one could create the menu XDGMenu when it is opened using
AddToMenu XDGMenu "XDGMenu" Title
+ DynamicPopUpAction PipeRead 'fvwm-menu-desktop'
This will create the menu when it is opened. One issue here is it will only create the menu the first time it is opened, and you still have to Regenerate the menu to see any changes. To create the menu each time it is open, use the --dynamic option:
AddToMenu XDGMenu "XDGMenu" Title
+ DynamicPopUpAction PipeRead 'fvwm-menu-desktop \
--dynamic --include-items config'
+ DynamicPopDownAction DestroyMenu recreate XDGMenu
This will now Destroy the menu when it's closed, so it can be rebuilt the next time it is opened. The recreate flag doesn't completely destroy the menu β it keeps the DynamicPopUpAction and DynamicPopDownAction actions π
The --dynamic flag includes the recreate option in the generated menus.
To insert a menu into MenuFvwmRoot and still be dynamic, you need to use a function that generates the whole menu. For example
DestroyFunc GenRootMenu
AddToFunc GenRootMenu
+ I DestroyMenu recreate MenuFvwmRoot
+ I AddToMenu MenuFvwmRoot "Fvwm" Title
+ I AddToMenu MenuFvwmRoot "Item1" Action1
...
+ I AddToMenu MenuFvwmRoot "ItemN" ActionN
+ I AddToMenu MenuFvwmRoot "" Nop
+ PipeRead `fvwm-menu-desktop --insert-in-menu MenuFvwmRoot \
--include-items config`
AddToMenu MenuFvwmRoot "Fvwm" Title
+ DynamicPopUpAction GenRootMenu
+ DynamicPopDownAction DestroyMenu recreate MenuFvwmRoot
π BUGS π
The whole process of creating menus from files is slow. Not me stating the obvious but it fr is π
Otherwise, report bugs to the fvwm-workers mailing list <fvwm-workers@fvwm.org>.
π AUTHORS π
This script is based on fvwm-xdg-menu.py written by Piotr Zielinski (http://www.cl.cam.ac.uk/~pz215/) who assigned Licence: GPL 2 Date: 03.12.2005.
The script was reworked to replace the existing fvwm-menu-desktop perl script by the fvwm-workers. Iconic behaviour tbh π
π COPYING π
The script is distributed by the same terms as fvwm itself. See GNU General Public License for details.
And that's the whole page, bestie! π This little masterpiece comes to you from the 3rd Berkeley Distribution, dated 19 October 2022 (2.7.0), and yes it's the fvwm-menu-desktop(1) man page π¦ Go forth and build the cutest XDG menu ever, you absolute main character πβ¨
π¦ where this page comes from
- alpine 3.24: fvwm-doc 2.7.0-r3 Β· GPL-2.0-or-later
- fedora 43: fvwm 2.7.0-15.fc43 Β· GPL-2.0-or-later
- fedora 44: fvwm 2.7.0-16.fc44 Β· GPL-2.0-or-later
- nixos 26.05: fvwm 2.7.0
- nixpkgs unstable: fvwm 2.7.0
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: fvwm2 2.7.0-bp160.1.11 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms