12

Ubuntu 18.04 添加自定义app到桌面和搜索栏

 3 years ago
source link: https://blog.csdn.net/yanxiangtianji/article/details/81083299
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

创建.desktop文件

按照下面这个格式填写你要用的.desktop文件。其中Exec是必须的,启动参数也可以添加在后面,Name也是必须的,用于搜索和显示。Comment和Icon可以忽略。如果是命令行脚本并且想要看到命令行,可以把Terminal后面改为true。

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=command to run here
Name=visible name here
Comment=comment here
Icon=icon path here

例如,我下载了“Bilibili直播弹幕库”的linux版,放在了我的home目录下的Softwares文件夹,那么我可以这么创建这么一个bilibili-live-helper.desktop文件:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.1.3
Type=Application
Terminal=false
Exec=/home/<username>/Softwares/Bilibili直播弹幕库-linux-x64/Bilibili直播弹幕库 --enable-transparent-visuals --disable-gpu
Name=Bilibili直播弹幕库
Comment=Bilibili直播弹幕库
#Icon=icon path here

添加到桌面

将创建好的.desktop文件复制到~/Desktop/目录,这样在桌面就可以看到它了。

添加到app搜索

将创建好的.desktop文件复制到~/.local/share/applications/目录,这样在搜索app的时候就可以搜到它了。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK