New comment by gspe on void-packages repository https://github.com/void-linux/void-packages/issues/28036#issuecomment-770407450 Comment: I'll post an update here so if someone have problems with D-Bus configuration can find some help. I've taken inspiration from how kde plasma wayland is started, https://github.com/KDE/plasma-workspace/blob/master/startkde/plasma-dbus-run-session-if-needed I have modified the wrap script to run sway `/usr/bin/sway-run.sh` as follow: ``` #!/bin/sh # Session export XDG_SESSION_TYPE=wayland export XDG_SESSION_DESKTOP=sway export XDG_CURRENT_DESKTOP=sway # D-Bus # If the session bus is not available it is spawned and wrapper round our program # Otherwise we spawn our program directly drs= if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ] then drs=dbus-run-session fi # Environment # Source environmental variable from all files in PATH_ENVIRONMENT # file should be named *.conf and have KEY=value format use # for comment PATH_ENVIRONMENT=$HOME/.config/environment.d if [ -d "$PATH_ENVIRONMENT" ]; then for i in "$PATH_ENVIRONMENT"/*.conf ; do if [ -f "$i" ]; then set -a; . "$i"; set +a fi done fi exec ${drs} sway "$@" ``` So if there is already a running dbus user session sway is started normally but if there isn't any the script start one dbus user session and sway inside it. With this script Environmental variable are read from `~/.config/environment.d` directory, like how systemd user does. User can put any file ending in `*.conf` inside this directory and they are sourced before sway start importing any `KEY=value` defined into environment. In my case i have ` ~/.config/environment.d/wayland.conf` like this: ``` # recomended enviroment variables for sway based desktop MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland-egl CLUTTER_BACKEND=wayland ECORE_EVAS_ENGINE=wayland-egl ELM_ENGINE=wayland_egl SDL_VIDEODRIVER=wayland _JAVA_AWT_WM_NONREPARENTING=1 NO_AT_BRIDGE=1 # QT theme QT_QPA_PLATFORMTHEME=qt5ct ``` With this modification I don't have `/etc/sway/env` anymore but an user defined configuration `~/.config/environment.d/wayland.conf`