River: Difference between revisions

From Alpine Linux
(Added reference to setup-wayland-base script)
 
(66 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[https://github.com/riverwm/river River] is a dynamic tiling Wayland compositor. An introduction to River can be found in [https://isaacfreund.com/blog/river-intro/ this blog post] by the author for the 0.1.0 release. 
[https://github.com/riverwm/river River] is a dynamic tiling [[Wayland]] compositor.  


This wiki was written starting from a fresh install using the Alpine 3.14.2 x86_64 extended .iso. The steps begin from the first reboot after running setup-alpine and performing a sys install to disk.  
{{:Include:Desktop prerequisites}}
The <Code>setup-wayland-base</Code> script installs and enables [[elogind]] as [[Seat manager|seat manager]], enables [[Repositories#Community|community repository]] and enables [[eudev]] automatically as these are required for Wayland to work.


== First Boot ==
== Installation ==
 
On the first boot after a new Alpine installation, there are some basic system configuration tasks typically done regardless of whether you plan to run a GUI desktop or not. These are the steps I run through:
 
Login as root, create a new user and update group membership:
{{Cmd|adduser sodface
addgroup sodface audio
addgroup sodface input
addgroup sodface video
addgroup sodface wheel
}}
 
Edit the repositories file and uncomment the community and testing repos:
{{Cat|/etc/apk/repositories|
http://dl-cdn.alpinelinux.org/alpine/v3.14/main
http://dl-cdn.alpinelinux.org/alpine/v3.14/community
#http://dl-cdn.alpinelinux.org/alpine/edge/main
#http://dl-cdn.alpinelinux.org/alpine/edge/community
http://dl-cdn.alpinelinux.org/alpine/edge/testing
}}
 
Install sudo and run visudo, uncommenting the desired permissions for the wheel group:
{{Cmd|apk update
apk add sudo && visudo}}
 
Logout and log back in as the new user. 
Test ssh login from a remote computer. 
Verify that you can run commands with sudo. 


The following links contain guides for setting up the video stack.
Install River and the documentation:


* [https://wiki.alpinelinux.org/wiki/Intel_Video Intel Video]
{{Cmd|# apk add {{Pkg|river}} {{Pkg|river-doc}}}}
* [https://wiki.alpinelinux.org/wiki/Radeon_Video Radeon Video]


Add yourself to the input and video groups:
<code>river-doc</code> is required if you want use the example config.


<pre>
Install your choice of additional packages:
# adduser $USER input
# adduser $USER video
</pre>


You have to log out and back in for this to take effect.  
This list includes icons, fonts, and a terminal emulator named foot which is the default in River's sample init file that we will use later.


Install some TTF fonts:
{{Cmd|# apk add {{Pkg|adwaita-icon-theme}} {{Pkg|foot}} {{Pkg|font-dejavu}}}}


<pre>
=== Set up eudev ===
# apk add ttf-dejavu
{{:Include:Setup_Device_Manager}}
</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:
=== Install Graphics Drivers ===


<dl>
Install [[graphics driver]] for your video hardware. Without proper driver, River will fail to start.


<dt>seatd daemon</dt>
=== Setup up a seat manager ===
<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.
Wayland compositors need raw access to input and output devices. This is mediated by a [[seat manager]].  
</dd>


<dt>seatd-launch</dt>
Configure either [[seatd]] or [[elogind]] as both are supported. However using both may lead to conflicts.
<dd>
[[Seatd|Install and configure seatd to start automatically]].
<pre>
# apk add seatd-launch
</pre>


When starting sway, you will need to prefix invocation with <code>seatd-launch</code>. 
== Running River ==
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 ==


We can now install sway:
Before running River for the first time, copy the sample init file to ~/.config:


<pre>
{{Cmd|install -Dm0755 /usr/share/doc/river/examples/init -t ~/.config/river}}
# 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
</pre>


== Running Sway ==
Set [[Wayland#XDG_RUNTIME_DIR|XDG_RUNTIME_DIR]] and then start River:


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:
{{Cmd|1=river}}


<pre>
== Troubleshooting ==
$ XDG_RUNTIME_DIR=/tmp sway
</pre>


(if you run sway with seatd-launch, you will need to use <code>$ XDG_RUNTIME_DIR=/tmp seatd-launch sway</code>)
Following are a few notes that are most certainly not related to River whatsoever but rather discovered while running River so I'm tacking them onto the end of this wiki.


See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration
Firefox 89.0.1 complains on launch "glxtest: libpci missing", resolved by:


{{Note|
{{Cmd|apk add {{Pkg|pciutils-libs}}}}
swaylock needs to be able to read your <code>/etc/shadow</code> file to be able to validate your password
}}


== Configuration and Usage ==
Firefox 89.0.1 complains continuously "Unable to load hand2 from the cursor theme", resolved by:


An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings.
{{Cmd|mkdir -p ~/.icons/default
ln -s /usr/share/icons/Adwaita/cursors ~/.icons/default/cursors}}


For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream FAQ].
== See also ==
[https://isaacfreund.com/blog/river-intro/ An introduction to River]


[[Category:Compositor]]
[[Category:Desktop]]
[[Category:Desktop]]
[[Category:Wayland]]

Latest revision as of 07:11, 9 January 2025

River is a dynamic tiling Wayland compositor.

Note: Before installing any desktop,

The setup-wayland-base script installs and enables elogind as seat manager, enables community repository and enables eudev automatically as these are required for Wayland to work.

Installation

Install River and the documentation:

# apk add river river-doc

river-doc is required if you want use the example config.

Install your choice of additional packages:

This list includes icons, fonts, and a terminal emulator named foot which is the default in River's sample init file that we will use later.

# apk add adwaita-icon-theme foot font-dejavu

Set up eudev

Setting up eudev on a desktop system is recommended in Alpine Linux. Without a fully functional device manager users will not be able to connect to input devices. The alpine-conf package provides setup-devd script to easily install and setup device managers.

Setup eudev.

# setup-devd udev

For more details and other options see eudev.

Install Graphics Drivers

Install graphics driver for your video hardware. Without proper driver, River will fail to start.

Setup up a seat manager

Wayland compositors need raw access to input and output devices. This is mediated by a seat manager.

Configure either seatd or elogind as both are supported. However using both may lead to conflicts. Install and configure seatd to start automatically.

Running River

Before running River for the first time, copy the sample init file to ~/.config:

install -Dm0755 /usr/share/doc/river/examples/init -t ~/.config/river

Set XDG_RUNTIME_DIR and then start River:

river

Troubleshooting

Following are a few notes that are most certainly not related to River whatsoever but rather discovered while running River so I'm tacking them onto the end of this wiki.

Firefox 89.0.1 complains on launch "glxtest: libpci missing", resolved by:

apk add pciutils-libs

Firefox 89.0.1 complains continuously "Unable to load hand2 from the cursor theme", resolved by:

mkdir -p ~/.icons/default ln -s /usr/share/icons/Adwaita/cursors ~/.icons/default/cursors

See also

An introduction to River