diff --git a/README.md b/README.md index 151eeda..5688c57 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,8 @@ Because xwayland-satellite is a Wayland client (in addition to being a Wayland c cargo build cargo run ``` + +## Systemd support +xwayland-satellite can be built with systemd support - simply add `-F systemd` to your build command - i.e. `cargo build --release -F systemd`. +With systemd support, satellite will send a state change notification when Xwayland has been initialized, allowing for having services dependent on satellite's startup. +An example service file is located in `resources/xwayland-satellite.service` - be sure to replace the `ExecStart` line with the proper location before using it. It can be placed in a systemd user unit directory (i.e. `$XDG_CONFIG_HOME/systemd/user` or `/etc/systemd/user`), and be launched and enabled with `systemctl --user enable --now xwayland-satellite`. It will be started when the `graphical-session.target` is reached, which is likely after your compositor is started if it supports systemd. diff --git a/resources/xwayland-satellite.service b/resources/xwayland-satellite.service new file mode 100644 index 0000000..060ab6b --- /dev/null +++ b/resources/xwayland-satellite.service @@ -0,0 +1,15 @@ +[Unit] +Description=Xwayland outside your Wayland +BindsTo=graphical-session.target +PartOf=graphical-session.target +After=graphical-session.target +Requisite=graphical-session.target + +[Service] +Type=notify +NotifyAccess=all +ExecStart=/usr/local/bin/xwayland-satellite +StandardOutput=journal + +[Install] +WantedBy=graphical-session.target