os/modules/sway/config/config.d/systemd.conf
Benjamin Bädorf 6d1d683b23
Fix swayidle command, add hibernation on lid close, fix env
The swayidle command in the service was straight up broken, this commit
fixes that.

Environment Variables set in the `session-variables` file are now
correctly imported across the system. This fixes `EDITOR` defaulting to
`nano`.
2022-08-25 00:13:23 +02:00

9 lines
749 B
Plaintext

# Note that the systemctl commands must be run synchronously and can't be split into
# three exec statements, since otherwise the session target may be started before
# systemctl import-environment is complete, and services that require certain variables
# will fail to run.
# https://github.com/swaywm/sway/wiki/Systemd-integration
# Also, import the most important environment variables into the D-Bus and systemd
# user environments (e.g. required for screen sharing and Pinentry prompts):
exec "systemctl --user import-environment; systemctl --user start sway-session.target; exec dbus-update-activation-environment --systemd $IMPORT_ENVIRONMENT_ENV_LIST DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP; systemd-cat --identifier=sway sway"