sway icon indicating copy to clipboard operation
sway copied to clipboard

XDG_RUNTIME_DIR is not set in the environment (new Arch installation, with Sway)

Open brianbecsi opened this issue 2 years ago • 1 comments

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.

brianbecsi avatar Oct 05 '22 02:10 brianbecsi

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!

beatplucker avatar Oct 11 '22 04:10 beatplucker

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.

josteink avatar Jan 15 '23 09:01 josteink

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.

josteink avatar Jan 16 '23 06:01 josteink

Closing, as this is a distro related issue.

bl4ckb0ne avatar Jan 16 '23 16:01 bl4ckb0ne

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

suhail-akhtar avatar Sep 30 '23 07:09 suhail-akhtar