2021-05-30 19:10:28 +00:00
|
|
|
# Note that the systemctl commands must be run synchronously and can't be split into
|
2021-08-23 21:22:55 +00:00
|
|
|
# three exec statements, since otherwise the session target may be started before
|
2021-05-30 19:10:28 +00:00
|
|
|
# systemctl import-environment is complete, and services that require certain variables
|
|
|
|
# will fail to run.
|
|
|
|
# https://github.com/swaywm/sway/wiki/Systemd-integration
|
2021-11-29 13:10:21 +00:00
|
|
|
# Also, import the most important environment variables into the D-Bus and systemd
|
|
|
|
# user environments (e.g. required for screen sharing and Pinentry prompts):
|
2024-03-06 17:42:25 +00:00
|
|
|
exec "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemctl --user start sway-session.target; dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"
|
|
|
|
exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target
|