mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-09-11 15:56:04 +03:00
Add Dbus activation service and systemd unit file (#50)
* Provide dbus and systemd service files by default * Split ExecReload command in two, since swaync-client only handles one argument per run. Co-authored-by: nightly-brew <>
This commit is contained in:
parent
98c5fb7e09
commit
4e35be8626
29
meson.build
29
meson.build
@ -7,6 +7,35 @@ project('sway-notificaton-center', ['c', 'vala'],
|
||||
subdir('src')
|
||||
|
||||
datadir = get_option('datadir')
|
||||
libdir = get_option('libdir')
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
|
||||
|
||||
# Dbus service
|
||||
configure_file(
|
||||
configuration: conf_data,
|
||||
input: 'services/dbus/org.erikreider.swaync.service.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: datadir + '/dbus-1/services'
|
||||
)
|
||||
|
||||
# Systemd service unit
|
||||
systemd = dependency('systemd', required: false)
|
||||
if get_option('systemd-service')
|
||||
if systemd.found()
|
||||
systemd_service_install_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
|
||||
else
|
||||
systemd_service_install_dir = join_paths(libdir, 'systemd', 'user')
|
||||
endif
|
||||
|
||||
configure_file(
|
||||
configuration: conf_data,
|
||||
input: 'services/systemd/swaync.service.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: systemd_service_install_dir
|
||||
)
|
||||
endif
|
||||
|
||||
# Zsh completion
|
||||
if get_option('zsh-completions')
|
||||
|
@ -1,3 +1,4 @@
|
||||
option('systemd-service', type: 'boolean', value: true, description: 'Install systemd user service unit.')
|
||||
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
||||
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
||||
option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.')
|
||||
|
4
services/dbus/org.erikreider.swaync.service.in
Normal file
4
services/dbus/org.erikreider.swaync.service.in
Normal file
@ -0,0 +1,4 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.Notifications
|
||||
Exec=@bindir@/swaync
|
||||
SystemdService=swaync.service
|
18
services/systemd/swaync.service.in
Normal file
18
services/systemd/swaync.service.in
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Swaync notification daemon
|
||||
Documentation=https://github.com/ErikReider/SwayNotificationCenter
|
||||
PartOf=graphical-session.target
|
||||
After=graphical-session.target
|
||||
Requisite=graphical-session.target
|
||||
# ConditionEnvironment requires systemd v247 to work correctly
|
||||
ConditionEnvironment=WAYLAND_DISPLAY
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.freedesktop.Notifications
|
||||
ExecStart=@bindir@/swaync
|
||||
ExecReload=@bindir@/swaync-client --reload-config && @bindir@/swaync-client --reload-css
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
Loading…
Reference in New Issue
Block a user