build: ship labwc-session.target systemd user unit

Add a small systemd user target modelled on miracle-wm-session.target.
It binds to graphical-session.target and orders after
graphical-session-pre.target, so systemd user services declaring
WantedBy=graphical-session.target (panels, portals, notification
daemons, ...) start and stop in sync with a labwc session.

Installed into $systemduserunitdir when the systemd dependency is
available at configure time; on systems without systemd the install
is skipped and labwc's runtime activation of the target fails
gracefully.
This commit is contained in:
Jos Dehaes 2026-04-20 15:53:34 +02:00 committed by Johan Malm
parent 5c7bfe3c67
commit d8119cb354
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,6 @@
[Unit]
Description=labwc session
Documentation=man:labwc(1) man:systemd.special(7)
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target

View file

@ -211,6 +211,15 @@ install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland
install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal') install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal')
# Install labwc-session.target so that systemd user services with
# WantedBy=graphical-session.target start under labwc. Labwc activates
# this target itself in src/config/session.c on autostart.
systemd = dependency('systemd', required: false)
if systemd.found()
install_data('data/labwc-session.target',
install_dir: systemd.get_variable('systemduserunitdir'))
endif
icons = ['labwc-symbolic.svg', 'labwc.svg'] icons = ['labwc-symbolic.svg', 'labwc.svg']
foreach icon : icons foreach icon : icons
icon_path = join_paths('data', icon) icon_path = join_paths('data', icon)