Updated Systemd integration (markdown)

Caleb Bassi 2019-05-05 22:02:16 -07:00
parent 1044d2fb4c
commit 94b68a0627

@ -1,8 +1,8 @@
## Managing user applications with systemd
## Managing user applications with systemd
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 enable this integration, 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`.
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`: