RedHat CentOS系列桌面系统添加图表到桌面、开始菜单

图标加到桌面实际上就是编写一个.Desktop的配置文件使gnome-session等程序读取

以Eclipse 为例

桌面

[Desktop Entry]
Name=Eclipse
Comment=Use the code line
TryExec=gnome-terminal
Exec=/opt/eclipse/eclipse/eclipse
Icon=/opt/eclipse/eclipse/icon.xpm
Type=Application
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
X-GNOME-DocPath=/opt/eclipse/eclipse/readme/readme_eclipse.html
X-GNOME-Bugzilla-Bugzilla=eclipse
X-GNOME-Bugzilla-Product=eclipse
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=4.12.0
Categories=GNOME;GTK;System;TerminalEmulator;
StartupNotify=true
X-GNOME-SingleWindow=false

 

开始菜单

cd /usr/share/applications

vi eclipse.deskop

[Desktop Entry]
Name=Eclipse
GenericName=Text Editor
Comment=C++ Editor
Comment[zh_TW]=編輯文字
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/opt/eclipse/eclipse/eclipse
Icon=/opt/eclipse/eclipse/icon.xpm
Type=Application
Terminal=false
#Categories=Application;Utility;TextEditor;X-Red-Hat-Base;
Categories=Utility;TextEditor;Development;IDE;#此行决定您的程序在哪个子菜单
Encoding=UTF-8
StartupWMClass=Eclipse
X-Desktop-File-Install-Version=0.23

 

你可能感兴趣的:(C++)