익명 18:24

How to create a new category in the GNOME menu?

How to create a new category in the GNOME menu?

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



Top Answer/Comment:

These instructions are using system directories. Same setup could be done using user config directories, see linked docs for user path locations.

  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/

Notes:

상단 광고의 [X] 버튼을 누르면 내용이 보입니다