Skip to content

Instantly share code, notes, and snippets.

@adnan360
Last active March 5, 2024 05:33
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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:

@PercyTheB
Copy link

followed these instructions, and it still doesn't work. Starting sway by typing 'sway' returns this error

[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

@crocket
Copy link

crocket commented Feb 17, 2022

You should look up the error messages on search engines. Don't use google. Use searx, duckduckgo, presearch, startpage, ...

@rogerxx
Copy link

rogerxx commented Nov 8, 2022

I just purchased an Intel Arc A750 and struggling to get the graphics card working within (Void, or any distribution of) Linux for the past month, while the graphics/video card worked with Windows 10 without problems. Happened to find a recent Internet post stating somebody else could not get their Intel A750/A770 working with either Xorg or Gnome Wayland, however using Sway the video/graphics card finally worked. And low and behold, same here, this Intel A750 is coming alive with using Sway, Void Linux kernel 6.0.7_1 version, i915.force_probe Linux cmdline option, and just the older default installed dg2_dmc 2022.10.22 linux-firmware!

I also had a problem with no graphical mouse pointer or invisible mouse pointer:
$ export WLR_NO_HARDWARE_CURSORS=1 && sway --verbose

Already mentioned, if the DISPLAY variable is initialized, for example within $HOME/.bashrc or $HOME/.bash_profile file, ensure $DISPLAY variable is not set!
$ unset DISPLAY

Good work!

Now my only wish, besides all of my prior wishes including wishing to get this Intel A750 card working, is that SWAY would act more like DWM! Guess I'm going to be doing a lot of work with sway's config file.

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