Updated Systemd integration (markdown)

Caleb Bassi 2019-05-05 22:09:23 -07:00
parent 94b68a0627
commit 05db16bb90

@ -2,7 +2,7 @@
On systemd based Linux distributions, systemd can be used as an alternative way to start and manage user services and applications. Some general examples of services managed by systemd include gpg-agent, pulseaudio, dbus, etc, but in the case of sway, such services may also include waybar, swayidle, mako, and similar. Note that this method works for both X11 and Wayland programs.
In order to integrate sway with systemd and start user applications automatically when sway starts, we need to configure a sway session target that will also bind to the standard [graphical-session.target](https://www.freedesktop.org/software/systemd/man/systemd.special.html#graphical-session.target) user target. This allows services to be started by systemd after sway launches by specifying `WantedBy=sway-session.target` or `WantedBy=graphical-session.target`.
In order to integrate sway with systemd and start user applications automatically when sway starts, we need to configure a sway session target that will also bind to the standard [graphical-session.target](https://www.freedesktop.org/software/systemd/man/systemd.special.html#graphical-session.target) user target. This allows services to be started by systemd after sway launches by specifying `WantedBy=sway-session.target` or `WantedBy=graphical-session.target` in the application's systemd unit file.
To configure the sway session target, place the following systemd unit file either locally at `~/.config/systemd/user/sway-session.target`, or globally for all users at `/etc/systemd/user/sway-session.target`: