2

I have created a .menu file in /etc/xdg/menus/applications-merged/, created .directory file in /usr/share/desktop-directories/ and the various .desktop files i want to be in my custom menu under /usr/share/applications with a custom Categories extension Categories=X-nameofcategory yet still no menu appearing in my applications menu.

I am wondering if there is a step i am missing, i am not using alacarte because there are multiple applications that i need to create and alacarte is very manual, having to add directory paths for each icon, executable and there is no drag/drop method either. I had assumed there was a standard way to do this and have followed the steps that freedesktop describes but i am still at a loss. Any help or insight would be appreciated!

4

No one seems to know or wasn't able to answer so i'll throw up the solution I found!

There are 3 locations you should be concerned with:

  • /usr/share/desktop-directories
  • /etc/xdg/menus/applications-merged
  • /usr/share/applications

Bear in mind the last location is system-wide specific, if you want it just for your user, use: ~/.local/share/applications

Firstly we:

  1. Create a file called APPNAME.menu (substitute APPNAME for whatever you want to call it) in the folder location /etc/xdg/menus/applications-merged
  2. Input these contents:
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
        "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
<Name>Applications</Name> <!-- This is necessary for your directory to appear in the applications drop down -->
<Menu> <!--app -->
<Name>app</Name>
<Directory>APPNAME.directory</Directory>
<Include>
<Category>APPNAME</Category>
</Include>
</Menu> <!-- End app -->
</Menu> <!-- End Applications -->
  1. Save the file and create another file called APPNAME.directory in the folder location ( it should be the same name specified in the .menu file) /usr/share/desktop-directories with these contents:
[Desktop Entry]
Type=Directory
Name=AppName
Icon=/path/to/icon`

Note the .directory filename should be exactly the same as the .directory name you entered in the .menu file above.

  1. Create a standard .desktop file in ~/.local/share/applications or /usr/share/applications with these contents (substituting for your own program of course and the Categories=line MUST BE the same as the name you gave the .directory file eariler)
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/executable.sh
Name=ApplicationToRun
Icon=/path/to/icon
Categories=APPNAME
Comment=Comment for users
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.