让你自定义的子菜单与系统菜单平起平坐: 1.用文本编辑器打开 /etc/xdg/menus/applications.menu文件 2.添加如下内容: <!-- Games --><Menu>
让你自定义的子菜单与系统菜单平起平坐:
1.用文本编辑器打开 /etc/xdg/menus/applications.menu文件
2.添加如下内容:
<!-- Games --><Menu> <Name>Games</Name> <Directory>games.directory</Directory> <OnlyUnallocated /> <Include> <And> <Category>Games</Category> </And> </Include></Menu><!-- End Games -->
3.用文本编辑器打开/usr/share/desktop-directories/下任意一个扩展名为.directory的文件,另存为games.directory.
4.修改games.directory文件:
[Desktop Entry]Name=GamesName[zh_CN]=Games自定义菜单Comment=Games菜单Comment[zh_CN]=Games自定义菜单Icon=games.pngType=Directory
注:Name=Game 英文名字 必需
Name[zh_CN]=Games 中文名字 除非你用英文
Comment=Games menu 英文注释
Comment[zh_CN]=Games自定义菜单 中文注释
Icon=games.png 菜单的图标 自己到/usr/share/pixmaps目录里选
Type=Directory 表示是文件夹 必需
5.用文本编辑器打开一个/usr/share/applications目录中的快捷方式(随意),修改Categories项为Categories=Games
6.重新起动X系统(RedHat/Fedora Core基本上需要重启Linux了)
7.其中Games是我自己起的名字,可以为任意英文标识.
8.当你没有设置任何快捷方式到你的菜单项里时,你的菜单项是不会显示的!