Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum

How to add custom category to FreeDesktop menu

Started by wigwami, October 20, 2023, 11:38:11 PM

Previous topic - Next topic


I'm trying to create a custom category to appear in my jgmenu, called File.  I'm talking about a top-level category, not a custom sub menu that appear beneath one of the standard FreeDesktop-defined categories. And I don't want to manually add this category to jgmenu's prepend or append .csv files.

I'm running Sparky with Openbox only so I don't have access to menu editing tools found in Gnome, XFCE, etc. Here's what I've done so far

First, I created a new file in /usr/share/desktop-directories/.  Here's the content:
[Desktop Entry]

Second, I created a new XML file called in /etc/xdg/menus/applications-merged. Here's the content:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"

Lastly, I created a new .desktop file called thunar-bulk-rename.desktop in ~/.local/share/applications/.  Here's the content:

[Desktop Entry]
Name=Bulk Rename
Comment=Rename Multiple Files
GenericName=Bulk Rename
Exec=thunar --bulk-rename %F

As configured above, the Thunar Bulk Renamer program doesn't move from its original location in the jgmenu Accessories category.  I was told that in the .desktop file, the new category should have X- as a prefix; whether I keep or remove that prefix makes no difference. I also tried removing the other categories from the .desktop file and leaving only X-File (or File). The program appears under a new (yay) category called Other (boo). 

I assume that in both cases, the menu simply doesn't recognize my new, custom category and is defaulting back to either one of the other standard categories or creating the Other category when it doesn't know what else to do.

I must be making an error in either the .directory file or the .menu file but I have no idea what.  Any ideas are welcome, and thanks!

View the most recent posts on the forum