温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何实现Linux下桌面快捷方式创建

发布时间:2021-09-27 10:28:37 来源:亿速云 阅读:151 作者:iii 栏目:系统运维

本篇内容介绍了“如何实现Linux下桌面快捷方式创建”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

在你的Home/Desktop文件夹下面新建一个xxx.desktop的文件,并且加上执行权限

代码如下:

chmod +x xxx.desktop

具体内容参照下面的模板,顺便讲一下linux下软件的安装方法,以sublime text 2为例
下载sublime linux的安装包,在你的home目录新建一个目录名,可以叫app,或者myapps啥的,你自己明白就行,就是软件的安装目录,把sublime text 2解压到里面,于是整体的目录结构如下

代码如下:

--home\yournam
----apps\
------sublime text 2\

下面解释下模板的内容,第一行,是凡是标有可执行标记的脚本必备的注释,内容为执行该脚本的解释器地址,这里是解释桌面快捷方式用的
第二行开始就是具体的内容了
解释两个重要的地方,地一个是exec,这个是你的可执行文件的地址,如果中间包含空格,那么用引号扩起来
Icon,这个是你的应用的图标,要不默认图标很难看

代码如下:

#!/usr/bin/env xdg-open  
[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec="/home/bowman/apps/Sublime Text 2/sublime_text"
GenericName[zh_CN]=Sublime Texe 2
GenericName=Sublime Texe 2
Icon="/home/bowman/apps/Sublime Text 2/Icon/256x256/sublime_text.png"
MimeType=
Name[zh_CN]=Sublime Texe 2
Name=Sublime Texe 2
Path=
StartupNotify=true
Terminal=false
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=owen

关于category,这里有一个主要列表可供选择

he table below lists all Main Categories.
Main Category Description Notes
AudioVideo Application for presenting, creating, or processing multimedia (audio/video)
Audio An audio application Desktop entry must include AudioVideo as well
Video A video application Desktop entry must include AudioVideo as well
Development An application for development
Education Educational software
Game A game
Graphics Application for viewing, creating, or processing graphics
Network Network application such as a web browser
Office An office type application
Science Scientific software
Settings Settings applications Entries may appear in a separate menu or as part of a "Control Center"
System System application, "System Tools" such as say a log viewer or network monitor
Utility Small utility application, "Accessories"

references:
http://standards.freedesktop.org/menu-spec/latest/apa.html#main-category-registry
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

“如何实现Linux下桌面快捷方式创建”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI