Sway: Difference between revisions

From Alpine Linux
No edit summary
(Add instructions for picking libseat backend)
Line 36: Line 36:
# apk add ttf-dejavu
# apk add ttf-dejavu
</pre>
</pre>
Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, choose one of the following methods:
<dl>
<dt>seatd daemon</dt>
<dd>
<pre>
# apk add seatd
# rc-update add seatd
# rc-service seatd start
# adduser $USER seat
</pre>
If you are already logged in as a $USER, you will need to relogin.
</dd>
<dt>seatd-launch</dt>
<dd>
<pre>
# apk add seatd-launch
</pre>
When starting sway, you will need to prefix invocation with <code>seatd-launch</code>. 
Note: <code>seatd-launch</code> is a suid binary, so it might be wise to use one of the other methods from a security perspective.
</dd>
<dt>elogind daemon</dt>
<dd>
TODO
</dd>
</dl>


== Installation ==
== Installation ==
Line 58: Line 91:
$ XDG_RUNTIME_DIR=/tmp sway
$ XDG_RUNTIME_DIR=/tmp sway
</pre>
</pre>
(if you run sway with seatd-launch, you will need to use <code>$ XDG_RUNTIME_DIR=/tmp seatd-launch sway</code>)


See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration
See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration

Revision as of 15:15, 21 October 2021

Sway is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.

Prerequisites

First, install & configure eudev:

# apk add eudev
# setup-udev

Then install graphics drivers appropriate to your system:

# apk add mesa-dri-gallium  # gallium
# apk add mesa-dri-classic  # or classic

The following links contain guides for setting up the video stack.

Add yourself to the input and video groups:

# adduser $USER input
# adduser $USER video

You have to log out and back in for this to take effect.

Install some TTF fonts:

# apk add ttf-dejavu

Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, choose one of the following methods:

seatd daemon
# apk add seatd
# rc-update add seatd
# rc-service seatd start
# adduser $USER seat

If you are already logged in as a $USER, you will need to relogin.

seatd-launch
# apk add seatd-launch

When starting sway, you will need to prefix invocation with seatd-launch. Note: seatd-launch is a suid binary, so it might be wise to use one of the other methods from a security perspective.

elogind daemon
TODO

Installation

We can now install sway:

# apk add sway sway-doc
# apk add                \ # Install optional dependencies:
    xwayland             \ # strongly reccommended for compatibility reasons
    alacritty            \ # default terminal emulator
    dmenu                \ # default application launcher
    swaylock             \ # lockscreen tool
    swayidle               # idle management (DPMS) daemon

Running Sway

To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. /tmp). Install & configure elogind to skip this step. Then run sway from the Linux console:

$ XDG_RUNTIME_DIR=/tmp sway

(if you run sway with seatd-launch, you will need to use $ XDG_RUNTIME_DIR=/tmp seatd-launch sway)

See the Wayland page for a permanent configuration

Configuration and Usage

An example config is provided at /etc/sway/config. Copy it to ~/.config/sway/config and read through it to learn the default keybindings.

For additional information, start at man 5 sway and read the upstream FAQ.