sway: 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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

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

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!

We’re not going to create a runtime dir - create it before starting sway. Plenty of ways to do that.