Linux Fedora20 配置desktop文件,将软件添加到应用程序浏览器中

来源:互联网 发布:long转int java 编辑:程序博客网 时间:2024/05/03 18:34

在fedora20上安装sublime text 3时发现,解压下载的sublime text 3后得到是一个文件夹,其中有可执行文件,并且有desktop文件。


关于linux desktop文件的介绍,阅读了IBM developerWorks 的 “ Linux Desktop Entry 文件深入解析 “

不知道为什么CSDN博客里禁用这个链接,把"."换成"。":

http://www。ibm。com/developerworks/cn/linux/l-cn-dtef/


我想把sublime放在home文件夹下的software下,于是修改了desktop文件。

原本desktop文件:

[Desktop Entry]Version=1.0Type=ApplicationName=Sublime TextGenericName=Text EditorComment=Sophisticated text editor for code, markup and proseExec=/opt/sublime_text/sublime_text %FTerminal=falseMimeType=text/plain;Icon=sublime-textCategories=TextEditor;Development;StartupNotify=trueActions=Window;Document;[Desktop Action Window]Name=New WindowExec=/opt/sublime_text/sublime_text -nOnlyShowIn=Unity;[Desktop Action Document]Name=New FileExec=/opt/sublime_text/sublime_text --command new_fileOnlyShowIn=Unity;

修改后的desktop文件:

#!/usr/bin/env xdg-open[Desktop Entry]Version=1.0Type=ApplicationName=Sublime TextGenericName=Text EditorComment=Sophisticated text editor for code, markup and proseExec=/home/ACM311/software/sublime_text_3/sublime_text %FTerminal=falseMimeType=text/plain;Icon=/home/ACM311/software/sublime_text_3/Icon/256x256/sublime-text.pngCategories=TextEditor;Development;StartupNotify=trueActions=Window;Document;[Desktop Action Window]Name=New WindowExec=/home/ACM311/software/sublime_text_3/sublime_text -nOnlyShowIn=Unity;[Desktop Action Document]Name=New FileExec=/home/ACM311/software/sublime_text_3/sublime_text --command new_fileOnlyShowIn=Unity;

将修改后的desktop文件用cp命令复制到/usr/share/applications下,这样在应用程序浏览器中就可以看到sublime了。


0 0
原创粉丝点击