mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
systemd --user support files
* adds a sway-session.target that binds to graphical-session.target (see man systemd.special) * also adds a 10-systemd script that should (must?) be included from sway that starts imports the sway environment variables into the systemd --user instance, and then starts sway-session.target The idea is that, any --user units that are wanted by either sway-session.target or graphical-session.target will be started when sway runs, and will have the correct environment from sway too.
This commit is contained in:
parent
410c961388
commit
510aafca75
4 changed files with 29 additions and 0 deletions
|
|
@ -153,6 +153,9 @@ subdir('client')
|
||||||
subdir('swaybg')
|
subdir('swaybg')
|
||||||
subdir('swaybar')
|
subdir('swaybar')
|
||||||
subdir('swaynag')
|
subdir('swaynag')
|
||||||
|
if systemd.found()
|
||||||
|
subdir('systemd')
|
||||||
|
endif
|
||||||
|
|
||||||
config = configuration_data()
|
config = configuration_data()
|
||||||
config.set('datadir', join_paths(prefix, datadir))
|
config.set('datadir', join_paths(prefix, datadir))
|
||||||
|
|
|
||||||
4
systemd/10-systemd
Normal file
4
systemd/10-systemd
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# should go to /etc/sway/config.d/10-systemd
|
||||||
|
#
|
||||||
|
exec systemctl --user import-environment
|
||||||
|
exec systemctl --user start sway-session.target
|
||||||
15
systemd/meson.build
Normal file
15
systemd/meson.build
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
systemd_dep = dependency('systemd')
|
||||||
|
|
||||||
|
if systemd_dep.found()
|
||||||
|
systemd_units = files(
|
||||||
|
'sway-session.target',
|
||||||
|
)
|
||||||
|
user_units_dir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
|
||||||
|
install_data(systemd_units, install_dir: user_units_dir)
|
||||||
|
|
||||||
|
sway_systemd_scripts = files(
|
||||||
|
'10-systemd',
|
||||||
|
)
|
||||||
|
|
||||||
|
install_data(sway_systemd_scripts, install_dir: sysconfdir + '/sway/config.d')
|
||||||
|
endif
|
||||||
7
systemd/sway-session.target
Normal file
7
systemd/sway-session.target
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[Unit]
|
||||||
|
Description=sway compositor session
|
||||||
|
Documentation=man:systemd.special(7)
|
||||||
|
BindsTo=graphical-session.target
|
||||||
|
Wants=graphical-session-pre.target
|
||||||
|
After=graphical-session-pre.target
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue