Skip to content

Instantly share code, notes, and snippets.

@adnan360
Last active October 23, 2025 17:51
Show Gist options
  • Save adnan360/6cba05a3881870bf4a9e3ab2cea7709e to your computer and use it in GitHub Desktop.
Save adnan360/6cba05a3881870bf4a9e3ab2cea7709e to your computer and use it in GitHub Desktop.
Running Sway (Wayland) on Void Linux (without SystemD)

Running Sway on Void Linux (without SystemD)

elogind is the part of SystemD logind that can run as standalone. So we need it to run Sway without SystemD. To do that we need to build wlroots with elogind option. Then we can install and use Sway as normal from the current repo. There are other ways to achieve this without elogind here. But I tried with the elogind option and I was successful.

UPDATE: I tried again on a fresh install. The elogind option is set by default on the repo version. So you can skip the xbps-src command below and continue. wlroots should install as a dependency of sway if you follow the later commands.

git clone git://github.com/void-linux/void-packages.git
cd void-packages
./xbps-src binary-bootstrap
./xbps-src pkg wlroots -o elogind
sudo xbps-install --repository=hostdir/binpkgs wlroots

Install things necessary and enable dbus also:

sudo xbps-install elogind sway dmenu rxvt-unicode sakura
sudo ln -s /etc/sv/dbus /var/services/

rxvt-unicode and sakura are optional. Sakura is Wayland supported, so it is good to have it handy.

You may also want to install swaylock and swayidle if you need.

Let's create the config directory for Sway: mkdir -p ~/.config/sway/

Now copy your i3config to ~/.config/sway/ or if you want to use the template config from Sway: cp /etc/sway/config ~/.config/sway/config

Now edit ~/.config/sway/config if necessary.

If you want to launch Sway directly after booting:

Run nano ~/.bashrc and add:

# If running from tty1, start sway
if [ "$(tty)" = "/dev/tty1" ]; then
	exec sway
fi

If it says that XDG_RUNTIME_DIR is not found, then this to fix it:

mkdir -p /tmp/swaytmp
export XDG_RUNTIME_DIR=/tmp/swaytmp

To kill the Sway session, $mod+Shift+e. $mod is the Super or Windows key by default if you didn't change it on config.

Ref:

@Szili007
Copy link

Szili007 commented Oct 20, 2025

if you get this error (@PercyTheB) :

[wlr] [libseat] [libseat/backend/logind.c:310] Could not activate session: Permission denied [wlr] [libseat] [libseat/libseat.c:79] No backend was able to open a seat [wlr] [backend/session/session.c:84] Unable to create seat: Function not implemented [wlr] [backend/session/session.c:218] Failed to load session backend [sway/server.c:53] Unable to create backend

Than the problem is that elogind is not running.
To fix it use this:
sudo ln -s /etc/sv/elogind /var/service/
importand command
sudo sv up elogind

(This command is missing from the tutorial @adnan360 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment