summaryrefslogtreecommitdiff
path: root/sway-git/50-systemd-user.conf
diff options
context:
space:
mode:
authormoxie <moxie.git@posteo.net>2026-02-02 16:57:44 +0000
committermoxie <moxie.git@posteo.net>2026-02-02 16:57:44 +0000
commitc923ab512290ff77436fbccb19a6a6ebbccc9476 (patch)
tree183d0d0f9e472633ab3ecfb66d27131d942c34b9 /sway-git/50-systemd-user.conf
init
Diffstat (limited to 'sway-git/50-systemd-user.conf')
-rw-r--r--sway-git/50-systemd-user.conf16
1 files changed, 16 insertions, 0 deletions
diff --git a/sway-git/50-systemd-user.conf b/sway-git/50-systemd-user.conf
new file mode 100644
index 0000000..8781db9
--- /dev/null
+++ b/sway-git/50-systemd-user.conf
@@ -0,0 +1,16 @@
+# sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment
+# See FS#63021
+# Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal.
+
+# Upstream refuses to set XDG_CURRENT_DESKTOP so we have to.
+exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
+exec systemctl --user import-environment DISPLAY \
+ SWAYSOCK \
+ WAYLAND_DISPLAY \
+ XDG_CURRENT_DESKTOP
+
+exec hash dbus-update-activation-environment 2>/dev/null && \
+ dbus-update-activation-environment --systemd DISPLAY \
+ SWAYSOCK \
+ XDG_CURRENT_DESKTOP=sway \
+ WAYLAND_DISPLAY