From c52b43b67a62fc3b15e6373146d37a6ec6ac957d Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 17 Jan 2026 11:51:25 +0900 Subject: [PATCH 1/3] Autostart using systemd instead of gnome-session Backport of the fix in NixOS: https://github.com/NixOS/nixpkgs/commit/d1de5b71fd5e5f7f021d6fc61b7e9ab0398e7d83 --- data/autostart.desktop | 15 --------------- data/io.elementary.settings-daemon.service | 12 ++++++++++++ data/meson.build | 21 +++++---------------- meson.build | 1 - po/POTFILES | 1 - 5 files changed, 17 insertions(+), 33 deletions(-) delete mode 100644 data/autostart.desktop create mode 100644 data/io.elementary.settings-daemon.service diff --git a/data/autostart.desktop b/data/autostart.desktop deleted file mode 100644 index e50d5e92..00000000 --- a/data/autostart.desktop +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Type=Application -Name=System Settings -Comment=System Settings background tasks -Exec=io.elementary.settings-daemon -Icon=io.elementary.settings -Terminal=false -Categories=System;Core; -NoDisplay=true -StartupNotify=true -X-GNOME-AutoRestart=true -X-GNOME-Autostart-Notify=true -X-GNOME-Autostart-Phase=Panel -X-GNOME-UsesNotifications=true -OnlyShowIn=Pantheon diff --git a/data/io.elementary.settings-daemon.service b/data/io.elementary.settings-daemon.service new file mode 100644 index 00000000..050e4db0 --- /dev/null +++ b/data/io.elementary.settings-daemon.service @@ -0,0 +1,12 @@ +[Unit] +Description=Settings Daemon +After=gnome-session-initialized.target + +[Install] +WantedBy=gnome-session-initialized.target + +[Service] +Type=exec +ExecStart=io.elementary.settings-daemon +Restart=on-failure +Slice=session.slice diff --git a/data/meson.build b/data/meson.build index 22c31034..abe38f86 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,19 +1,3 @@ -i18n.merge_file( - input: 'autostart.desktop', - output: meson.project_name() + '.desktop', - po_dir: meson.project_source_root() / 'po', - type: 'desktop', - install: true, - install_dir: datadir / 'applications' -) - -fs = import('fs') -meson.add_install_script( - symlink, - datadir / 'applications' / meson.project_name() + '.desktop', - (fs.is_absolute(sysconfdir) ? sysconfdir : (prefix / sysconfdir)) / 'xdg' / 'autostart' / meson.project_name() + '.desktop', -) - dbus_dep = dependency('dbus-1') dbus_interfaces_dir = dbus_dep.get_variable('interfaces_dir', pkgconfig_define: ['datadir', datadir]) @@ -87,4 +71,9 @@ if systemd_system_unit_dir != 'no' and systemd_user_unit_dir != 'no' meson.project_name() + '.system-update.timer', install_dir: systemd_user_unit_dir ) + + install_data( + meson.project_name() + '.service', + install_dir: systemd_user_unit_dir + ) endif diff --git a/meson.build b/meson.build index c2ccb1d1..cb022ac2 100644 --- a/meson.build +++ b/meson.build @@ -32,7 +32,6 @@ libgeoclue_dep = dependency ('libgeoclue-2.0') prefix = get_option('prefix') datadir = prefix / get_option('datadir') -sysconfdir = get_option('sysconfdir') conf_data = configuration_data() conf_data.set('PROJECT_NAME', meson.project_name()) diff --git a/po/POTFILES b/po/POTFILES index 0b8d50e9..918c1a68 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,4 +1,3 @@ -data/autostart.desktop data/settings-daemon.metainfo.xml.in src/Application.vala src/Backends/SystemUpdate.vala From ff3ccca48c7d377b7840ebfeab61de9fa29cde91 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 17 Jan 2026 15:11:55 +0900 Subject: [PATCH 2/3] meson: Drop update_desktop_database Because we no longer install any .desktop files and leaving this here causes build error on some environments: https://github.com/elementary/settings-daemon/pull/218#issuecomment-3762720271 --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index cb022ac2..0b2f089d 100644 --- a/meson.build +++ b/meson.build @@ -58,6 +58,5 @@ subdir('src') subdir('settings-portal') gnome.post_install( - glib_compile_schemas: true, - update_desktop_database: true + glib_compile_schemas: true ) From 4b06d74e303974e1a93123e244a9e601c51e9956 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 17 Jan 2026 15:22:53 +0900 Subject: [PATCH 3/3] Use absolute path for ExecStart Because settings-daemon.service fails to start settings-daemon in some environments: https://github.com/elementary/settings-daemon/pull/218#issuecomment-3762720271 --- ...on.service => io.elementary.settings-daemon.service.in} | 2 +- data/meson.build | 7 +++++-- meson.build | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) rename data/{io.elementary.settings-daemon.service => io.elementary.settings-daemon.service.in} (79%) diff --git a/data/io.elementary.settings-daemon.service b/data/io.elementary.settings-daemon.service.in similarity index 79% rename from data/io.elementary.settings-daemon.service rename to data/io.elementary.settings-daemon.service.in index 050e4db0..875bb2ba 100644 --- a/data/io.elementary.settings-daemon.service +++ b/data/io.elementary.settings-daemon.service.in @@ -7,6 +7,6 @@ WantedBy=gnome-session-initialized.target [Service] Type=exec -ExecStart=io.elementary.settings-daemon +ExecStart=@bindir@/io.elementary.settings-daemon Restart=on-failure Slice=session.slice diff --git a/data/meson.build b/data/meson.build index abe38f86..5a913ae7 100644 --- a/data/meson.build +++ b/data/meson.build @@ -47,6 +47,7 @@ if systemd_system_unit_dir != 'no' and systemd_user_unit_dir != 'no' service_config = configuration_data() service_config.set('busctl_path', busctl_path) + service_config.set('bindir', bindir) configure_file( input: meson.project_name() + '.check-for-firmware-updates.service.in', @@ -72,8 +73,10 @@ if systemd_system_unit_dir != 'no' and systemd_user_unit_dir != 'no' install_dir: systemd_user_unit_dir ) - install_data( - meson.project_name() + '.service', + configure_file( + input: meson.project_name() + '.service.in', + output: meson.project_name() + '.service', + configuration: service_config, install_dir: systemd_user_unit_dir ) endif diff --git a/meson.build b/meson.build index 0b2f089d..9b66d042 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,7 @@ libgeoclue_dep = dependency ('libgeoclue-2.0') prefix = get_option('prefix') datadir = prefix / get_option('datadir') +bindir = prefix / get_option('bindir') conf_data = configuration_data() conf_data.set('PROJECT_NAME', meson.project_name())