ubuntu 创建快捷方式和命令行启动、修改默认启动

ubuntu 创建快捷方式和命令行启动、修改默认启动

1.创建快捷方式

cd /usr/share/applications

sudo gedit typora.desktop
# 写入以下内容
[Desktop Entry]
Encoding=UTF-8
Name=app_name 	#应用程序的名称,即快捷方式的名词
Exec=/path/to/bin 	#启动程序的文件位置
Icon=/path/to/img	#图标
Categories=Application
Type=Application
# 示例
[Desktop Entry]
Version=1.0
Type=Application
Name=goland
Icon=/home/camile/goland/bin/goland.svg
Exec="/home/camile/goland/bin/goland.sh" %f
Comment=Cross-platform IDE built specially for Go developers
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-goland
StartupNotify=true                  

2. 命令启动

将可执行文件加入环境变量,即可在shell打开

gedit ~/.bashrc
# 在文件后面追加,以typora的执行文件为例
alias typora="/opt/Typora-linux-x64/Typora"
# 保存后,source生效
source ~/.bashrc     
# 示例
alias goland="/home/camile/goland/bin/goland.sh"

其他

1.修改文件位置以后需要修改 .desktop,有时选择属性无法修改的情况可以使用vim编辑器
2.创建快捷方式中的Name只和快捷方式名有关

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值