sway
sway copied to clipboard
XDG_RUNTIME_DIR is not set in the environment (new Arch installation, with Sway)
Hello! New user here.
I have a fresh Arch install which I installed using archinstall
. I try to run Sway but I get some errors that there was no backend able to open a seat [libseat/libseat.c:79]. I try to sudo but I get an error XDG_RUNTIME_DIR not set. I tried running sudo -E sway
but get the error "unable to drop root ... refusing to start".
Appreciate any help with this I don't know my way around X display.
Hi there.
You should add yourself to the seat
group and start/enable the seatd.service
and you should be good to go. I suggest you to check out the Sway page in the Arch wiki for further details.
Good luck!
I had this exact issue on both a previously working Ubuntu (22.10) sway-install and a fresh Arch install.
I can confirm the proposed solution worked on Arch. The Ubuntu-installation is gone, so cannot confirm or deny if that solution applies there too.
Ok. So after enabling seatd I tried disabling gdm and just boot straight into the tty.
For some reason I still got the same error as before. Seemingly I need to start/boot into gdm and from there on switch to the tty.
Then sway works. No idea why it is like that, or what dependency this triggers, but just leaving it here for other people with the same issue.
Closing, as this is a distro related issue.
The XDG_RUNTIME_DIR environment variable is used to specify the directory for user-specific runtime files. If it’s not set, you might encounter the error you’re seeing. Here’s how you can set it:
export XDG_RUNTIME_DIR=/run/user/$(id -u)
To make this change permanent, you can add the above line to your .bashrc
echo "export XDG_RUNTIME_DIR=/run/user/$(id -u)" >> ~/.bashrc
source ~/.bashrc
This should resolve the XDG_RUNTIME_DIR not set issue