From 9ade594b266927a10d08e02530747d71d579d05c Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Fri, 15 May 2026 17:01:11 +0800 Subject: [PATCH] feat: add dbus-activatable desktop entry for dde-shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. 确认服务按需启动并在不需要时自动停止 --- debian/dde-shell.install | 1 + misc/org.deepin.dde-shell.desktop | 12 ++++++++++++ shell/CMakeLists.txt | 4 +++- shell/main.cpp | 3 ++- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 misc/org.deepin.dde-shell.desktop diff --git a/debian/dde-shell.install b/debian/dde-shell.install index 62683587a..228149a31 100644 --- a/debian/dde-shell.install +++ b/debian/dde-shell.install @@ -13,6 +13,7 @@ usr/lib/*/qt6/qml/org/deepin/ds/notification/* usr/lib/*/qt6/qml/org/deepin/ds/notificationcenter/* usr/lib/systemd/*/dde-shell*.service usr/lib/systemd/*/dde-shell-plugin*.service +usr/share/applications/* usr/share/dde-dock/icons/dcc-setting/*.dci usr/share/dde-shell/*/translations usr/share/dde-shell/org.deepin.ds.dde-am*/ diff --git a/misc/org.deepin.dde-shell.desktop b/misc/org.deepin.dde-shell.desktop new file mode 100644 index 000000000..a7d9a6bca --- /dev/null +++ b/misc/org.deepin.dde-shell.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=Deepin Desktop Shell +Comment=Deepin desktop shell service +Icon=dde-shell +Exec=/bin/false +TryExec=/bin/false +DBusActivatable=true +NoDisplay=true +Terminal=false +StartupNotify=false +Categories=System; diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index cb8e3cdd4..5156e980b 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: CC0-1.0 @@ -59,6 +59,8 @@ install(FILES ${CMAKE_SOURCE_DIR}/misc/deepin-debug-config/org.deepin.dde.shell. DESTINATION ${CMAKE_INSTALL_DATADIR}/deepin-debug-config/deepin-debug-config.d) install(FILES ${CMAKE_SOURCE_DIR}/misc/deepin-log-config/org.deepin.dde.shell.json DESTINATION ${CMAKE_INSTALL_DATADIR}/deepin-log-viewer/deepin-log.conf.d) +install(FILES ${CMAKE_SOURCE_DIR}/misc/org.deepin.dde-shell.desktop + DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(TARGETS dde-shell DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/shell/main.cpp b/shell/main.cpp index 94ecb508d..eebd0069c 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -107,6 +107,7 @@ int main(int argc, char *argv[]) QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering); a.setOrganizationName("deepin"); a.setApplicationName("org.deepin.dde-shell"); + a.setDesktopFileName(QStringLiteral("org.deepin.dde-shell")); a.setApplicationVersion(QT_STRINGIFY(DS_VERSION)); QCommandLineParser parser;