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

在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.0

Type=Application

Name=Sublime Text

GenericName=Text Editor

Comment=Sophisticated text editor for code, markup and prose

Exec=/opt/sublime_text/sublime_text %F

Terminal=false

MimeType=text/plain;

Icon=sublime-text

Categories=TextEditor;Development;

StartupNotify=true

Actions=Window;Document;

[Desktop Action Window]

Name=New Window

Exec=/opt/sublime_text/sublime_text -n

OnlyShowIn=Unity;

[Desktop Action Document]

Name=New File

Exec=/opt/sublime_text/sublime_text --command new_file

OnlyShowIn=Unity;

修改后的desktop文件:

#!/usr/bin/env xdg-open

[Desktop Entry]

Version=1.0

Type=Application

Name=Sublime Text

GenericName=Text Editor

Comment=Sophisticated text editor for code, markup and prose

Exec=/home/ACM311/software/sublime_text_3/sublime_text %F

Terminal=false

MimeType=text/plain;

Icon=/home/ACM311/software/sublime_text_3/Icon/256x256/sublime-text.png

Categories=TextEditor;Development;

StartupNotify=true

Actions=Window;Document;

[Desktop Action Window]

Name=New Window

Exec=/home/ACM311/software/sublime_text_3/sublime_text -n

OnlyShowIn=Unity;

[Desktop Action Document]

Name=New File

Exec=/home/ACM311/software/sublime_text_3/sublime_text --command new_file

OnlyShowIn=Unity;

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

0818b9ca8b590ca3270a3433284dd417.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值