6

I want to create a custom category menu. How can I do that?

For example, I want to create a category menu named "Halogen" like Accessories, Games, Graphics, Internet..etc

6
  1. Need to write an XML .menu file to be installed in /etc/xdg/menus/applications-merged/

    Example /etc/xdg/menus/applications-merged/hamradio.menu

    <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
     "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
    <Menu>
      <Name>Applications</Name>
      <Menu>
        <Name>Hamradio</Name>
        <Directory>HamRadio.directory</Directory>
        <Include>
            <Category>HamRadio</Category>
        </Include>
      </Menu> <!-- End hamradio -->
    </Menu>
    
  2. A .directory file to be install in /usr/share/desktop-directories/

    Example /usr/share/desktop-directories/HamRadio.directory ([...] I removed some lines)

    [Desktop Entry]
    Type=Directory
    Encoding=UTF-8
    Name=Hamradio
    Name[bg]=Любителско радио
    Name[ca]=Radioaficionat
    Name[cs]=Amatérské rádio
    [...]
    Name[vi]=Truyền thành tài tử
    Name[zh_CN]=业余无线电
    Name[zh_TW]=業餘無線電
    Icon=CQ.png
    
  3. Add category to Categories= in application .desktop file and should be install in /usr/share/applications/

Reference: Freedesktop Menu Specification

1

Based on info from http://www.omgubuntu.co.uk/2013/05/add-categories-to-gnome-shell-dashboard and http://en.wikibooks.org/wiki/Using_GNOME/Application_menus

You need to open the dconf Editor (command dc)

From there navigate to org > gnome > shell You should see an entry called "app-folder-categories". Double click on this and add/remove categories as you desire.

You can also use the gsettings tool

gsettings get org.gnome.shell.app-folder-categories

would should you the current categories and you can use the set command write a new value (which would be a comma separated list of your categories.

To place you software into the new category you will need to edit the .desktop launcher files located in /usr/share/applications/ . There should be one for each application, if you open one in your editor you should see an entry called "Categories" and you can add/remove categories (including the one you just created).

  • 1
    I actually wanted a command line method for making a deb file but what it is said in the second link isn't working Making changes in Categories in .desktop file is not making any difference – ganeshredcobra Mar 18 '14 at 10:03
  • 1
    Hi, might be worth mentioning this in the question to make it clearer that what you need is for packaging. – NGRhodes Mar 18 '14 at 14:14
1

This extension should do what you want: https://extensions.gnome.org/extension/1217/appfolders-manager/

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.