summaryrefslogtreecommitdiff
path: root/dwl/dwl-patches/patches/systemd/README.md
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwl/dwl-patches/patches/systemd/README.md
Diffstat (limited to 'dwl/dwl-patches/patches/systemd/README.md')
-rwxr-xr-xdwl/dwl-patches/patches/systemd/README.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/dwl/dwl-patches/patches/systemd/README.md b/dwl/dwl-patches/patches/systemd/README.md
new file mode 100755
index 0000000..a861b5e
--- /dev/null
+++ b/dwl/dwl-patches/patches/systemd/README.md
@@ -0,0 +1,33 @@
+### Description
+This is a simple patch that runs `systemctl --user import-environment WAYLAND_DISPLAY DISPLAY`, and `systemctl --user start dwl-session.target` after Dwl initializes, and then `systemctl --user stop dwl-session.target` when Dwl quits. This allows you to handle graceful startup and shutdown of your graphical systemd services, with the proper environment variables set. This is similar to [uwsm](https://github.com/Vladimir-csp/uwsm?tab=readme-ov-file), but it integrates natively with your existing systemd user services, and doesn't have uwsm's runtime overhead.
+
+You must have a `dwl-session.target` created that binds to `graphical-session.target`. You can then set the WantedBy of your systemd services to either `graphical-session.target`, or `dwl-session.target`, depending on whether you want them to start for just Dwl, or for every graphical session.
+
+Below is the Nix home-manager configuration I use to generate `dwl-session.target`, and its resulting output.
+```
+systemd.user.targets.dwl-session.Unit = {
+ Description = "dwl compositor session";
+ Documentation = [ "man:systemd.special(7)" ];
+ BindsTo = [ "graphical-session.target" ];
+ Wants = [ "graphical-session-pre.target" ];
+ After = [ "graphical-session-pre.target" ];
+};
+```
+
+```
+[Unit]
+After=graphical-session-pre.target
+BindsTo=graphical-session.target
+Description=dwl compositor session
+Documentation=man:systemd.special(7)
+Wants=graphical-session-pre.target
+```
+
+### Download
+- [git branch](https://github.com/Shringe/dwl/tree/systemd)
+- [0.7](/dwl/dwl-patches/raw/branch/main/patches/systemd/systemd-0.7.patch)
+
+### Authors
+- [Shringe](https://codeberg.org/Shringe)
+- shringe_ at [dwl Discord](https://discord.gg/jJxZnrGPWN)
+