我是靠谱客的博主 微笑糖豆,最近开发中收集的这篇文章主要介绍[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单行注释的

效果图:


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



额外详解

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

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

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

Table 2. Standard Keys

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

最后

以上就是微笑糖豆为你收集整理的[Desktop Entry] -- Linux桌面快捷方式配置文件小解环境:配置文件:效果图:额外详解的全部内容,希望文章能够帮你解决[Desktop Entry] -- Linux桌面快捷方式配置文件小解环境:配置文件:效果图:额外详解所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(38)

评论列表共有 0 条评论

立即
投稿
返回
顶部