1
0
mirror of https://github.com/tiyn/wiki.git synced 2026-07-26 04:21:34 +02:00

Wayland: Expanded Migration and Setup, Added Alternative Programs

This commit is contained in:
2026-07-14 05:20:11 +02:00
parent cbbad11edc
commit d77b0dc5ad
5 changed files with 179 additions and 4 deletions

View File

@@ -8,8 +8,10 @@ This entry also features medicinal image and visual formats such as DICOM.
## Viewer
- [sxiv](https://github.com/xyb3rt/sxiv) is an image viewer for [Linux'](/wiki/linux.md)
[X window system](/wiki/linux/x_window_system.md).
[X window system](/wiki/linux/x_window_system.md).
- [Weasis](https://github.com/nroduit/Weasis) is a cross-platform DICOM viewer.
- [imv](https://sr.ht/~exec64/imv/) is an image viewer native to [Linux'](/wiki/linux.md)
[Wayland](/wiki/linux/wayland.md).
## Editors

View File

@@ -45,6 +45,17 @@ Check which session is created by your compositor.
ln -s /usr/share/wayland-sessions/<session> /usr/share/wayland-sessions/default.desktop
```
However, for Wayland the call for the compositor can also occur in the `.profile` file or another
file that is called at startup.
In this case replace the `Exec` line with a dummy.
This can look similar to the following.
```txt
Exec=echo "ok"
```
Alternatively to linking the session to `default.desktop` the `.dmrc` file can also be set to the
name of the session.
Before finishing the setup the functionality should be tested.
This can be done by using one or both of the following commands.

View File

@@ -3,14 +3,137 @@
[Wayland](https://wayland.freedesktop.org/) is a replacement for the
[X11 window system](/wiki/linux/x_window_system.md).
## Setup
For Wayland to work properly the following is needed.
- a Wayland [compositor](#compositors)
- `wayland`
- `wayland-protocols`
- optionally `xwayland` for running [X11](/wiki/linux/x_window_system.md) applications
- optionally `xdg-desktop-portal` and a suitable backend (e.g. `xdg-desktop-portal-wlr`) for screen
sharing and desktop integration
Wayland is then started via the Compositor.
When migrating from X11 to Wayland additional steps may have to be taken.
Since the start is done via the compositor some settings especially potential `startx` statements
in the `.profile` or other files that are run on login (e.g. by [systemd](/wiki/linux/systemd.md))
to start X11 need to be removed.
In the correponding places statements to start the Wayland compositor may be put.
## Statusbar
This section focuses on Wayland statusbars.
### Waybar
Waybar is a simple status bar which in most [Linux distributions](/wiki/linux.md#distributions) can
simply be installed via the [package](/wiki/linux/package_manager.md) `waybar`.
It can then be started using the `waybar` command after choosing the settings inside
`.config/waybar`.
## Compositors
The following is a list of Wayland compositors.
- [dwl](/wiki/linux/suckless.md) is a compositor which is similar to suckless' X11 window manager
called dwm.
- [dwl](/wiki/linux/suckless.md) is a compositor which is similar to
[suckless'](/wiki/linux/suckless.md) X11 window manager called dwm.
To make dwl start additional software the `-s` flag followed by a [shell](/wiki/linux/shell.md)
file can be used.
This will run all commands within the file.
An example may look similar to `dwl -s ~/.config/wayland/wayland.conf`.
For toggling the touchpad the patch called
[inputdevicerules](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/inputdevicerules/inputdevicerules-v0.6.patch)
can be used.
- [mango](https://github.com/mangowm/mango) is a feature-rich Wayland compositor built on dwl.
## Programs
This section contains Wayland-native alternatives to common X11 programs.
Further alternatives can be found in the
[Sway migration guide](https://github.com/swaywm/sway/wiki/i3-Migration-Guide).
### Background
`swaybg` can be used to set the desktop background.
### Hotkey Daemon
`swhkd` is a Wayland alternative to [sxhkd](/wiki/linux/sxhkd.md).
After installation create the configuration file
`~/.config/swhkd/swhkdrc` and mark the binary as setuid.
```sh
sudo chmod u+s $(which swhkd)
```
The daemon can then be started using
```sh
swhks && swhkd
```
### Lock Screen
`swaylock` can be used as a lock screen.
Configuration is stored in `~/.config/swaylock/config`.
A lock screen can then be activated using
```sh
swaylock
```
### Idle Daemon
`swayidle` is a Wayland replacement for idle management.
### Screenshots
Wayland screen capture can be achieved using
- `grim` for taking screenshots
- `slurp` for selecting a region
- `wl-clipboard` for clipboard integration
Together these can replace tools such as `maim`.
### Display Configuration
`wlr-randr` can be used instead of `xrandr` for wlroots-based compositors.
Many Wayland compositors configure displays automatically, making manual configuration unnecessary
in many cases.
### Input Events
`wev` is a Wayland alternative to `xev`.
### Window Information
The functionality of `xprop` can be replaced by a combination of `lswt`, `wlrctl`
(`wlrctl toplevel list`) as well as compositor-specific IPC interfaces.
### Color Temperature
`wlsunset` provides functionality similar to `redshift`.
### Image Viewer
[imv](https://sr.ht/~exec64/imv/) is a Wayland-native [image viewer](/wiki/image.md#viewer) and can
be used instead of `sxiv`.
### Desktop Managers
There are many [display managers](/wiki/linux/display_managers.md) which support Wayland
compositors.
[LightDM](/wiki/linux/lightdm.md) is especially easy to use and the corresponding entry contains a
[setup section for dwl](/wiki/linux/lightdm.md).
## Usage
This section addresses the usage of Wayland.
@@ -24,6 +147,45 @@ For this to work the compositor needs to use wlroots.
wlr-randr
```
### Setup Screen Capture
Many Wayland applications access [screen capture](/wiki/screen_capture.md) or
[sharing](/wiki/screen_sharing.md) through `xdg-desktop-portal`.
This setup is required by applications such as [Discord](/wiki/discord.md) and [OBS](/wiki/obs.md).
Install the following packages.
- `xdg-desktop-portal-gtk`
- `xdg-desktop-portal-wlr`
- `qt5-wayland`
- `qt6-wayland`
Set the following environment variables.
```sh
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=wlroots
```
Import the variables into the user systemd instance during startup.
```sh
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
```
Create the file `~/.config/xdg-desktop-portal/portals.conf` with the following contents.
```ini
[preferred]
default=gtk
org.freedesktop.impl.portal.Screenshot=wlr
org.freedesktop.impl.portal.ScreenCast=wlr
```
Afterward, restart the system.
Then screen capture and sharing should be available.
## Troubleshooting
This section addresses problems that can occur when using Wayland and ways to solve them.

View File

@@ -2,7 +2,7 @@
Screen capture describes the process of recording a computer screen.
For the remotely displaying the screen to another device the
[corresponding entry](/wiki/screen-sharing.md) contains tips and tricks.
[corresponding entry](/wiki/screen_sharing.md) contains tips and tricks.
## Screen Capture options