我正在寻找gnome3.28和rhel 7.6中的子菜单的子菜单
但是看起来gnome3和rhel7只允许一个子菜单。
有什么办法可以拥有子菜单的子菜单吗?
我已经在gnome2和rhel6中尝试了以下相同的步骤,并且效果很好,但是在rhel7和gnome3中却无法正常工作,整个子菜单目录Submenu1和Submenu2都消失了。提前致谢。我还使用了Alacarte来创建子菜单的子菜单,但是它与手动创建桌面文件的方式相同,并且不起作用
所以,如果我想要这样的东西,那就很好
Applications > CustomMenu > Submenu1 Applications > CustomMenu > Submenu2
但是如果我想要这样的东西就行不通了
Applications > CustomMenu > Submenu1 > Submenu1A Applications > CustomMenu > Submenu1 > Submenu1B Applications > CustomMenu > Submenu2
Submenu2A Applications > CustomMenu > Submenu2 > Submenu2B
的工作案例
应用程序> CustomMenu>子菜单1应用程序> CustomMenu> Submenu2
/etc/xdg/menus/applications-merged/CustomMenu.menu
```<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> <Menu>
<Name>Applications</Name>
<Menu>
<Name>CustomMenu</Name>
<Directory>CustomMenu.directory</Directory>
<Include>
<And>
<Category>CustomMenu</Category>
</And>
</Include>
</Menu> <!-- End CustomMenu -->
</Menu>
/usr/share/desktop-directories/CustomMenu.directory
```[Desktop Entry]
Name=CustomMenu
Comment=Custom Menu
Type=Directory
```
/usr/share/applications/submenu1.directory
```[Desktop Entry]
Encoding=UTF-8
Name=Submenu1
Exec=java -jar /tmp/submenu1.jar
Categories=CustomMenu;Submenu1;
Type=Application
Terminal=true
```
/usr/share/applications/submenu2.directory
```[Desktop Entry]
Encoding=UTF-8
Name=Submenu2
Exec=java -jar /tmp/submenu2.jar
Categories=CustomMenu;Submenu2;
Type=Application
Terminal=true
```
Not working case for
Applications > CustomMenu > Submenu1 > Submenu1A
Applications > CustomMenu > Submenu1 > Submenu1B
Applications > CustomMenu > Submenu2 > Submenu2A
Applications > CustomMenu > Submenu2 > Submenu2B
/etc/xdg/menus/applications-merged/CustomMenu.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
<Name>Applications</Name>
<Menu>
<Name>CustomMenu</Name>
<Directory>CustomMenu.directory</Directory>
<Include>
<And>
<Category>CustomMenu</Category>
<Not>
<Category>Submenu1</Category>
<Category>Submenu2</Category>
</Not>
</And>
</Include>
<Menu>
<Name>SubMenu1</Name>
<Directory>Submenu1.directory</Directory>
<Include>
<And>
<Category>Submenu1</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>SubMenu2</Name>
<Directory>Submenu2.directory</Directory>
<Include>
<And>
<Category>Submenu2</Category>
</And>
</Include>
</Menu>
</Menu> <!-- End CustomMenu -->
</Menu>
```
The /usr/share/desktop-directories/CustomMenu.directory is same as before
I have added
/usr/share/desktop-directories/Submenu1.directory
[Desktop Entry] Name=Submenu1 Comment=Sub Menu 1 Type=Directory
/usr/share/desktop-directories/Submenu2.directory
[Desktop Entry] Name=Submenu2 Comment=Sub Menu 2 Type=Directory
>
/usr/share/applications/submenu1A.directory
[Desktop Entry]
Encoding=UTF-8
Name=Submenu1A Exec=java -jar /tmp/submenu1A.jar
Categories=CustomMenu;Submenu1;Submenu1A; Type=Application
Terminal=true
/usr/share/applications/submenu1B.directory
[Desktop Entry] Encoding=UTF-8 Name=Submenu1B Exec=java -jar /tmp/submenu1B.jar Categories=CustomMenu;Submenu1;Submenu1B;
Type=Application Terminal=true
>
/usr/share/applications/submenu2A.directory
>
[Desktop Entry] Encoding=UTF-8 Name=Submenu2A Exec=java -jar /tmp/submenu2A.jar Categories=CustomMenu;Submenu2;Submenu2A;
Type=Application Terminal=true
> /usr/share/applications/submenu2B.directory
>
[Desktop Entry] Encoding=UTF-8 Name=Submenu2B Exec=java -jar /tmp/submenu2B.jar Categories=CustomMenu;Submenu2;Submenu2B;
Type=Application Terminal=true