Skip to content

feat: add dbus-activatable desktop entry for dde-shell#1600

Open
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:desktop
Open

feat: add dbus-activatable desktop entry for dde-shell#1600
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:desktop

Conversation

@18202781743
Copy link
Copy Markdown
Contributor

  1. Add a new desktop entry file org.deepin.dde-shell.desktop in the
    misc directory
  2. Configure the entry as a DBusActivatable application with Exec and
    TryExec set to /bin/false
  3. Set NoDisplay to true to hide from menus and launchers
  4. Categorize it under System for organization purposes
  5. This enables the DDE shell service to be started on demand via D-
    Bus activation

Log: Added D-Bus activation support for DDE Shell service

Influence:

  1. Verify that dde-shell can be activated via D-Bus when needed
  2. Test that the entry does not appear in application menus or launchers
  3. Confirm that the service starts on demand and stops when no longer
    needed

feat: 为 dde-shell 添加 D-Bus 激活的 desktop 条目

  1. 在 misc 目录中添加新的 desktop 文件 org.deepin.dde-shell.desktop
  2. 配置该条目为 DBusActivatable 应用,Exec 和 TryExec 设置为 /bin/false
  3. 设置 NoDisplay 为 true 以隐藏于菜单和启动器中
  4. 归类到 System 类别以便于组织管理
  5. 这使得 DDE shell 服务可以通过 D-Bus 激活按需启动

Log: 新增 DDE Shell 服务的 D-Bus 激活支持

Influence:

  1. 验证 dde-shell 能否在需要时通过 D-Bus 激活
  2. 测试该条目不会出现在应用菜单或启动器中
  3. 确认服务按需启动并在不需要时自动停止

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Comment thread misc/org.deepin.dde-shell.desktop
@deepin-bot
Copy link
Copy Markdown

deepin-bot Bot commented May 20, 2026

TAG Bot

New tag: 2.0.42
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1603

BLumia
BLumia previously approved these changes May 27, 2026
1. Add a new desktop entry file org.deepin.dde-shell.desktop in the
misc directory
2. Configure the entry as a DBusActivatable application with Exec and
TryExec set to /bin/false
3. Set NoDisplay to true to hide from menus and launchers
4. Categorize it under System for organization purposes
5. This enables the DDE shell service to be started on demand via D-
Bus activation

Log: Added D-Bus activation support for DDE Shell service

Influence:
1. Verify that dde-shell can be activated via D-Bus when needed
2. Test that the entry does not appear in application menus or launchers
3. Confirm that the service starts on demand and stops when no longer
needed

feat: 为 dde-shell 添加 D-Bus 激活的 desktop 条目

1. 在 misc 目录中添加新的 desktop 文件 org.deepin.dde-shell.desktop
2. 配置该条目为 DBusActivatable 应用,Exec 和 TryExec 设置为 /bin/false
3. 设置 NoDisplay 为 true 以隐藏于菜单和启动器中
4. 归类到 System 类别以便于组织管理
5. 这使得 DDE shell 服务可以通过 D-Bus 激活按需启动

Log: 新增 DDE Shell 服务的 D-Bus 激活支持

Influence:
1. 验证 dde-shell 能否在需要时通过 D-Bus 激活
2. 测试该条目不会出现在应用菜单或启动器中
3. 确认服务按需启动并在不需要时自动停止
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

你好!我是CodeGeeX。我已仔细审查了你提供的Git Diff。本次代码变更主要为DDE-Shell添加了桌面入口文件、应用图标资源,更新了构建与安装脚本,并修改了版权声明年份。

整体来看,代码逻辑清晰,变更合理。但为了提升代码质量、安全性和规范性,我提出以下审查意见和改进建议:

1. 语法与逻辑

  • .desktop 文件的 ExecTryExec 逻辑问题
    • 问题:在 misc/org.deepin.dde-shell.desktop 中,Exec=/bin/falseTryExec=/bin/false 看起来非常反直觉。虽然结合 DBusActivatable=true,系统会通过DBus激活该服务而忽略 Exec,但/bin/false 是一个总是返回失败状态码(1)的命令,这在语义上是不正确的,且如果某些桌面环境或工具(如菜单编辑器、启动器)尝试直接执行此命令,会导致不可预料的错误。
    • 建议:对于纯DBus激活的服务,建议将 Exec 指向真实可执行文件或使用占位符,并移除 TryExec
      # 建议修改为:
      Exec=dde-shell --dbus-activate
      # TryExec=/bin/false  <-- 建议直接删除此行,或改为 TryExec=dde-shell

2. 代码质量

  • 版权年份格式规范

    • 问题:在 shell/CMakeLists.txtshell/main.cpp 中,版权年份被修改为 2023 - 2026。通常,版权声明中的结束年份应该是代码实际发布或创作的年份,而不是未来的年份(当前尚未到2026年)。此外,年份范围通常使用短横线 (En dash) 而非连字符 - (Hyphen),或者直接用逗号分隔。
    • 建议:如果2026是预期生命周期,建议在发布当年再更新;或者改为更规范的格式:2023, 20242023–2024
  • 硬编码路径

    • 问题.desktop 文件中的 Exec=/bin/false 使用了硬编码的绝对路径。在Linux生态中,可执行文件通常位于 /usr/bin/usr/local/bin
    • 建议:如果修改了 Exec,建议仅使用可执行文件名(如 Exec=dde-shell),让系统通过 PATH 环境变量去查找,这更符合FreeDesktop标准。

3. 代码性能

  • 资源文件编译优化
    • 问题:新增了 dde-shell-icons.qrc 并将其添加到 add_executable 中。Qt的资源系统(qrc)会在编译时将文件嵌入到二进制文件中。如果 icons/dde-shell.dci 图标文件较大,会导致编译时间变长,且增加主程序的二进制体积和内存占用。
    • 建议:如果该图标仅在 .desktop 文件中被引用(系统桌面环境读取),建议不需要将其嵌入到qrc中,而是像 .desktop 文件一样,直接通过 CMake 的 install(FILES ...) 命令将其安装到系统的图标目录(如 ${CMAKE_INSTALL_DATADIR}/icons)。
    • 如果该图标确实需要在QML/Qt运行时内部使用,则保留qrc,但需注意文件大小。

4. 代码安全

  • .desktop 文件的执行权限与合法性

    • 问题:如前所述,Exec=/bin/false 存在安全隐患。虽然它不会直接执行恶意代码,但 /bin/false 作为一个具有执行权限的系统二进制,被当作占位符滥用,可能在某些沙箱环境(如Flatpak/Snap权限配置)或SELinux策略中引发误报或拒绝执行日志。
    • 建议:确保 .desktop 文件在安装后具有正确的权限(644),且内容合法合规。移除对 /bin/false 的依赖。
  • 通配符安装规则

    • 问题:在 debian/dde-shell.install 中添加了 usr/share/applications/*。使用通配符 * 安装整个目录可能会在未来的开发中无意打包进不需要的或存在安全隐患的 .desktop 文件。
    • 建议:尽可能明确指定文件名,而不是使用通配符:
      # 建议修改为:
      usr/share/applications/org.deepin.dde-shell.desktop
      

总结与修改后的代码示例

misc/org.deepin.dde-shell.desktop (建议修改后):

[Desktop Entry]
Type=Application
Name=Deepin Desktop Shell
Comment=Deepin desktop shell service
Icon=dde-shell
Exec=dde-shell
DBusActivatable=true
NoDisplay=true
Terminal=false
StartupNotify=false
Categories=System;

debian/dde-shell.install (建议修改后):

# ... 其他内容保持不变 ...
usr/share/applications/org.deepin.dde-shell.desktop
# ... 其他内容保持不变 ...

shell/CMakeLists.txt (关于版权年份的建议):

# SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd.

希望这些审查意见对你有所帮助!如果有任何疑问,欢迎继续探讨。

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants