Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
D-Bus activation systemd service
Correctly scopes dolphin in systemd service `app-org.kde.dolphin.service` when dbus-activated (while still working if systemd is not present), as per https://systemd.io/DESKTOP_ENVIRONMENTS/

uses new ECM modules:
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/5 to simplify the systemd service templating + install
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/17 to generate the dbus service file automatically

needs https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/25
  • Loading branch information
unusual-thoughts committed Oct 21, 2020
1 parent 40cc911 commit eb441b1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Expand Up @@ -8,14 +8,16 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})

set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.73.0")
set(KF5_MIN_VERSION "5.75.0")

# ECM setup
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGenerateDBusServiceFile)
include(ECMConfiguredInstall)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
include(FeatureSummary)
Expand Down Expand Up @@ -155,10 +157,16 @@ install(FILES
COMPONENT Devel
)

configure_file(org.kde.dolphin.FileManager1.service.in
${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
ecm_generate_dbus_service_file(
NAME org.freedesktop.FileManager1
EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
SYSTEMD_SERVICE plasma-dolphin.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
RENAME org.kde.dolphin.FileManager1.service
)

ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})

install(FILES dolphin.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Expand Down
3 changes: 0 additions & 3 deletions org.kde.dolphin.FileManager1.service.in

This file was deleted.

8 changes: 8 additions & 0 deletions plasma-dolphin.service.in
@@ -0,0 +1,8 @@
[Unit]
Description=Dolphin file manager
PartOf=graphical-session.target

[Service]
ExecStart=@KDE_INSTALL_FULL_BINDIR@/dolphin --daemon
BusName=org.freedesktop.FileManager1
Slice=background.slice

0 comments on commit eb441b1

Please sign in to comment.