From a50ad8bd4219e0d1e3402c3156a887a787f4afbd Mon Sep 17 00:00:00 2001 From: "lion.chan" Date: Fri, 25 Dec 2020 01:00:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BA=A7=20Desktop=20Entry=20=E8=AE=BE=E7=BD=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lion.chan --- .../Linux/User/创建_Desktop_Entry.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Software/Development/OperatingSystem/Linux/User/创建_Desktop_Entry.md b/Software/Development/OperatingSystem/Linux/User/创建_Desktop_Entry.md index ee3431c..abbb76c 100644 --- a/Software/Development/OperatingSystem/Linux/User/创建_Desktop_Entry.md +++ b/Software/Development/OperatingSystem/Linux/User/创建_Desktop_Entry.md @@ -1,8 +1,10 @@ # 创建 Desktop Entry +## 1.系统级设置 + Linux 桌面图标入口不仅仅是一个可编辑文件,称作 Desktop Entry,扩展名为“.desktop”。一般集中保存在 /usr/share/applications 目录下。 -一个应用程序 .desktop 参考模板如下: +两个应用程序 .desktop 参考模板如下: ```ini [Desktop Entry] @@ -15,4 +17,24 @@ MimeType=x-scheme-handler/gtkterm; Categories=Network; ``` +```ini +[Desktop Entry] +Name=STM32CubeIDE +Comment=STM32CubeIDE 1.5.0 +GenericName=STM32CubeIDE +Exec=env GDK_BACKEND=x11 stm32cubeide %F +Icon=stm32cubeide +Path=/opt/stm32cubeide/ +Terminal=false +StartupNotify=true +Type=Application +Categories=Development +``` + 应用程序图标保存在 /usr/share/icons 目录下,图标通过 MIME 配置文件与程序关联。 + +## 2.用户级设置 + +在 ~/.local/share/applications 目录下也可以保存 Desktop Entry,这个目录属于用户级别设置,只对当前用户有效。 + +如果 ~/.local/share/applications 与 /usr/share/applications 目录下存在同名称文件,则用户级别设置生效。有时系统级别设置有效,而用户级别设置无效,将导致菜单中无法找到该应用的入口。