From d77b0dc5ad435c95d65eeccf813c5ae655e0f47e Mon Sep 17 00:00:00 2001 From: tiyn Date: Tue, 14 Jul 2026 05:20:11 +0200 Subject: [PATCH] Wayland: Expanded Migration and Setup, Added Alternative Programs --- wiki/image.md | 4 +- wiki/linux/lightdm.md | 11 ++ wiki/linux/wayland.md | 166 +++++++++++++++++- wiki/screen_capture.md | 2 +- wiki/{screen-sharing.md => screen_sharing.md} | 0 5 files changed, 179 insertions(+), 4 deletions(-) rename wiki/{screen-sharing.md => screen_sharing.md} (100%) diff --git a/wiki/image.md b/wiki/image.md index 31e8973..746469a 100644 --- a/wiki/image.md +++ b/wiki/image.md @@ -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 diff --git a/wiki/linux/lightdm.md b/wiki/linux/lightdm.md index 97d178e..3ae0f53 100644 --- a/wiki/linux/lightdm.md +++ b/wiki/linux/lightdm.md @@ -45,6 +45,17 @@ Check which session is created by your compositor. ln -s /usr/share/wayland-sessions/ /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. diff --git a/wiki/linux/wayland.md b/wiki/linux/wayland.md index 0bd660a..4195ed8 100644 --- a/wiki/linux/wayland.md +++ b/wiki/linux/wayland.md @@ -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. diff --git a/wiki/screen_capture.md b/wiki/screen_capture.md index 8c78348..c1167ec 100644 --- a/wiki/screen_capture.md +++ b/wiki/screen_capture.md @@ -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 diff --git a/wiki/screen-sharing.md b/wiki/screen_sharing.md similarity index 100% rename from wiki/screen-sharing.md rename to wiki/screen_sharing.md