linux 桌面快捷方式[Desktop Entry]

以eclipse为例,最简单的Desktop Entry:

[Desktop Entry]
Exec=/opt/eclipse/eclipse
Type=Application

一般内容:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true 


主要的参数及其作用如下表【来源:http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html】


Key Description Value Type REQ? Type
Type This specification defines 3 types of desktop entries: Application (type 1), Link (type 2) and Directory (type 3). To allow the addition of new types in the future, implementations should ignore desktop entries with an unknown type. string YES  
Version Version of the Desktop Entry Specification that the desktop entry conforms with. Entries that confirm with this version of the specification should use1.0. Note that the version field is not required to be present. string NO 1-3
Name Specific name of the application, for example "Mozilla". localestring YES 1-3
GenericName Generic name of the application, for example "Web Browser". localestring NO 1-3
NoDisplay NoDisplay means "this application exists, but don't display it in the menus". This can be useful to e.g. associate this application with MIME types, so that it gets launched from a file manager (or other apps), without having a menu entry for it (there are tons of good reasons for this, including e.g. thenetscape -remote, or kfmclient openURL kind of stuff). boolean NO 1-3
Comment Tooltip for the entry, for example "View sites on the Internet". The value should not be redundant with the values ofName and GenericName. localestring NO 1-3
Icon Icon to display in file manager, menus, etc. If the name is an absolute path, the given file will be used. If the name is not an absolute path, the algorithm described in theIcon Theme Specification will be used to locate the icon. localestring NO 1-3
Hidden Hidden should have been called Deleted. It means the user deleted (at his level) something that was present (at an upper level, e.g. in the system dirs). It's strictly equivalent to the.desktop file not existing at all, as far as that user is concerned. This can also be used to "uninstall" existing files (e.g. due to a renaming) - by lettingmake install install a file with Hidden=true in it. boolean NO 1-3
OnlyShowIn, NotShowIn A list of strings identifying the environments that should display/not display a given desktop entry. Only one of these keys, eitherOnlyShowIn or NotShowIn, may appear in a group (for possible values see theDesktop Menu Specification). string(s) NO 1-3
TryExec Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example). string NO 1
Exec Program to execute, possibly with arguments. See the Exec key for details on how this key works. string YES 1
Path If entry is of type Application, the working directory to run the program in. string NO 1
Terminal Whether the program runs in a terminal window. boolean NO 1
Actions Identifiers for application actions. This can be used to tell the application to make a specific action, different from the default behavior. TheApplication actions section describes how actions work. string(s) NO 1
MimeType The MIME type(s) supported by this application. string(s) NO 1
Categories Categories in which the entry should be shown in a menu (for possible values see theDesktop Menu Specification). string(s) NO 1
Keywords A list of strings which may be used in addition to other metadata to describe this entry. This can be useful e.g. to facilitate searching through entries. The values are not meant for display, and should not be redundant with the values ofName or GenericName. localestring(s) NO 1
StartupNotify If true, it is KNOWN that the application will send a "remove"message when started with the DESKTOP_STARTUP_ID environment variable set.If false, it is KNOWN that the application does not workwith startup notification at all (does not shown any window, breakseven when using StartupWMClass, etc.).If absent, a reasonable handling is up to implementations (assuming false,using StartupWMClass, etc.). (See theStartup Notification Protocol Specification for more details). boolean NO 1
StartupWMClass If specified, it is known that the application will map at least onewindow with the given string as its WM class or WM name hint (see theStartup Notification Protocol Specification for more details). string NO 1
URL If entry is Link type, the URL to access. string YES 2

更详细的内容:http://blog.chinaunix.net/uid-20332519-id-3015914.html


你可能感兴趣的:(linux)