data: Add systemd unit to start alert slider service

This commit is contained in:
Guido Günther
2024-09-27 07:27:08 +00:00
committed by Guido Günther
parent 0a2392db3f
commit 7ea55aeaf5
5 changed files with 36 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Feedbackd Alert Slider Handler
PartOf=graphical-session.target
[Service]
ExecStart=@libexecdir@/fbd-alert-slider
Restart=on-abnormal
RestartSec=10s
[Install]
WantedBy=graphical-session.target
+20
View File
@@ -72,4 +72,24 @@ if get_option('udev')
install_data('90-feedbackd.rules', install_dir: udevdir)
endif
systemd_user_unit_dir = get_option('systemd_user_unit_dir')
systemd_dep = dependency('systemd', required: false)
if systemd_user_unit_dir == ''
if systemd_dep.found()
systemd_user_unit_dir = systemd_dep.get_variable('systemd_user_unit_dir')
else
systemd_user_unit_dir = prefix / libdir / 'systemd' / 'user'
endif
endif
# Alert slider Systemd user service
alert_slider_unit = 'fbd-alert-slider.service'
configure_file(
input : alert_slider_unit + '.in',
output : alert_slider_unit,
configuration : service_data,
install : true,
install_dir : systemd_user_unit_dir,
)
endif # daemon
+1
View File
@@ -1,4 +1,5 @@
usr/bin/
usr/lib/systemd/user
usr/lib/udev/
usr/libexec/
usr/share/dbus-1/
+1
View File
@@ -27,6 +27,7 @@ if get_option('daemon')
gsound = dependency('gsound')
gudev = dependency('gudev-1.0', version: '>=232')
json_glib = dependency('json-glib-1.0')
systemd_dep = dependency('systemd', required: false)
endif
prefix = get_option('prefix')
+3
View File
@@ -16,3 +16,6 @@ option('man',
option('tests',
type: 'boolean', value: true,
description: 'Whether to compile unit tests')
option('systemd_user_unit_dir',
type: 'string', value: '',
description: 'Directory for systemd user units')