[Desktop Entry] -- Linux桌面快捷方式配置文件小解

          刚在eclipse官网下载了eclipse4.2.2. 发现里面没有自带快捷方式的配置文件。然而我们平时不可能每次都找到软件的目录再启动~~SO..


我先贴出我的快捷方式的配置文件再做一一解释--- ! -_-  勤做笔记,方便以后回顾


环境:


  1. Ubuntu 13.04
  2. Unity Desktop
  3. Eclipse 4.2.2

配置文件

[Desktop Entry]
Version=4.2.2                                                 
//这里面是设置软件的版本

Enconde=UTF-8                                                 
//这个是设置配置文件的字符编码

Name=ecipse                                                   
//这个是Desktop Entry的名字,若只有这个,默认显示这个

Name[zh_CN]=eclipse                                           
//这个是Desktop Entry的中文名字,若是其他语言,只要更改方括号里面的语言参数即可

GenericName=eclipse                                           
//这个是通用名字,好像在窗口才能显示设置的名字

Comment=JAVA IDE                                              
//当前Desktop Entry的简单描述

Exec=/home/crper/eclipse/eclipse                              
//程序执行路径

Terminal=false                                                
//是否在终端运行,boolean类型,ture  or false

Type=Application                                              
//运行类型,程序或者连接,也就是Application   or link(若是这个需要添加URL参数)

Catagories=Application;Program;                               
//程序归类,很好理解的就是在启动菜单能明显看出来
 
Icon=/home/crper/eclipse/1.png                                 
//Desktop Entry的启动图标,支持xpm , png (其他木有尝试过)             

StartupNotify=false                                            
//很直白的参数。。启动通知,只针对Application有效

OnlyShowIn=Unity;                                              
//这个是说Desktop Entry 运行在哪种桌面环境,常用的值有:GNOME;KDE;Unity;

注意:创建了Deskop Entry这个快捷方式,需要改变他的权限才能运行,默认是只读文件

实际配置文件中不可以存在C OR JAVA单行注释的

效果图:

[Desktop Entry] -- Linux桌面快捷方式配置文件小解_第1张图片


(这图片不是用shutter,国产优秀软件deepin scrot,比QQ截图强大)



额外详解

      刚才我写的配置是基础中的基础,想要了解更加详细和学习大的更多的,可以查看下这个网站(需要有一定英文水平--google找到的,强大的引擎)

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

  截取一部分参数出来保存,方便回顾

Table 2. Standard Keys

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, orkfmclient 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 andGenericName. 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 withHidden=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 orNotShowIn, 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

你可能感兴趣的:(linux,Desktop,快捷方式,entry,快捷方式配置)