In your desktop’s application launcher menu, right-click the icon for LibreOffice. See how it gives a menu of Writer, Calc, etc? That’s called an action menu. Have you ever wished you had something similar for some other program’s variants? For instance, Hugin, the Panorama Stitcher, makes 3 entries in your graphics sub-menu, and DisplayCAL, a program you will use only rarely if you’ve a need for it at all, makes 9, which may well be more than half of all entries in the submenu.
Here’s how to make an action menu.
First you need to know that the *.desktop entries from which your menu is assembled live in /usr/share/applications, but the items in that directory are over-ridden by whatever’s in /home/<user>/.local/share/applications. Start by copying the relevant *.desktop entries to the local directory. Sometimes the names are weird, but you can probably find them quickly by scanning for their icons.
For all the main entries you wish to replace with action menu entries, edit the corresponding *.desktop file and append the line “NoDisplay=true” - it’s case sensitive. The local entry will over-ride the global entry, and it won’t change. You COULD edit the global entry instead, but the next software update could undo all your hard work.
In the main *.desktop file, add the action menu. First, under the line “[Desktop Entry]” add a new line that says “Actions=1;2;3;4;” and so on, depending on how many entries your action menu will have. I think you need a semi-colon even after the last entry - in any case the referents I’ve seen all have one. As for the numerals, you can replace them with words if you want, because they’re just labels.
Above that line that says “[Desktop Entry]” type the following for each item in the action menu:
[Desktop Action 1]
Name=
Exec=
Icon=
Again, this is case-sensitive. Instead of 1, use whatever label corresponds to what you typed in the action list (and they’ll appear as ordered in that list). After those equals signs, cut and paste whatever was in the *.desktop files you’re replacing. Here are some examples, where the code replaces [Desktop Entry] in the original file:
Scilab.desktop
[Desktop Action scinotes]
Name=scinotes
Exec=xterm -title "Scilab launcher: DO NOT CLOSE" -e scinotes
Icon=scinotes
[Desktop Action xcos]
Name=xcos
Exec=xterm -title "Scilab launcher: DO NOT CLOSE" -e xcos
Icon=xcos
[Desktop Entry]
Actions=scinotes;xcos;
DisplayCAL.desktop
[Desktop Action LUT]
Name=3D LUT Maker
Exec=displaycal-3dlut-maker
Icon=displaycal-3dlut-maker
[Desktop Action Curve]
Name=Curve Viewer
Exec=displaycal-curve-viewer
Icon=displaycal-curve-viewer
[Desktop Action Profile-Info]
Name=Profile Infor
Exec=displaycal-profile-info
Icon=displaycal-profile-info
[Desktop Action Profile-Loader]
Name=Profile Loader
Exec=displaycal-apply-profiles --force
Icon=displaycal-apply-profiles
[Desktop Action Scripting]
Name=Scripting Client
Exec=displaycal-scripting-client
Icon=displaycal-scripting-client
[Desktop Action Synth-Profile]
Name=Synthetic Profile
Exec=displaycal-synthprofile
Icon=displaycal-synthprofile
[Desktop Action Testchart]
Name=Testchart Editor
Exec=displaycal-testchart-editor
Icon=displaycal-testchart-editor
[Desktop Action Converter]
Name=VRML to X3D Converter
Exec=displaycal-vrml-to-x3d-converter %F
Icon=displaycal-vrml-to-x3d-converter
[Desktop Entry]
Actions=LUT;Curve;Profile-Info;Profile-Loader;Scripting;Synth-Profile;Testchart;Converter;
Hugin.desktop
[Desktop Action Batch-Processor]
Exec=PTBatcherGUI %F
Name=Batch-Processor
[Desktop Action Lens-Calibrator]
Exec=calibrate_lens_gui
Name=Lens-Calibrator
[Desktop Entry]
Actions=Batch-Processor;Lens-Calibrator;
Notice that the last example has no Icon lines - that’s okay, the entries appear as text with no icon.
There’s no theoretical reason why you couldn’t lump disparate programs together this way, for instance create a KasualGames.desktop entry just to have an action menu full of KDE games. Let me know if you do anything cool with this technique!
GEF