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


KeyDescriptionValue TypeREQ?Type
TypeThis 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.stringYES 
VersionVersion 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.stringNO1-3
NameSpecific name of the application, for example "Mozilla".localestringYES1-3
GenericNameGeneric name of the application, for example "Web Browser".localestringNO1-3
NoDisplayNoDisplay 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).booleanNO1-3
CommentTooltip for the entry, for example "View sites on the Internet". The value should not be redundant with the values ofName and GenericName.localestringNO1-3
IconIcon 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.localestringNO1-3
HiddenHidden 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.booleanNO1-3
OnlyShowIn, NotShowInA 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)NO1-3
TryExecPath 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).stringNO1
ExecProgram to execute, possibly with arguments. See the Exec key for details on how this key works.stringYES1
PathIf entry is of type Application, the working directory to run the program in.stringNO1
TerminalWhether the program runs in a terminal window.booleanNO1
ActionsIdentifiers 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)NO1
MimeTypeThe MIME type(s) supported by this application.string(s)NO1
CategoriesCategories in which the entry should be shown in a menu (for possible values see theDesktop Menu Specification).string(s)NO1
KeywordsA 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)NO1
StartupNotifyIf 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).booleanNO1
StartupWMClassIf 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).stringNO1
URLIf entry is Link type, the URL to access.stringYES2

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


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值