From dc56f9885c3875a96e6b0a7ce6f6d5b4842a61d0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 3 Apr 2024 17:16:53 +0400 Subject: wiki: Improve Xwayland page --- wiki/Xwayland.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/wiki/Xwayland.md b/wiki/Xwayland.md index 95644ee9..3178a1a6 100644 --- a/wiki/Xwayland.md +++ b/wiki/Xwayland.md @@ -2,6 +2,7 @@ X11 is very cursed, so built-in Xwayland support is not planned at the moment. However, there are multiple solutions to running X11 apps in niri. ## Directly running Xwayland in rootful mode + This method involves invoking XWayland directly and running it as its own window, it also requires an extra X11 window manager running inside it. ![Xwayland running in rootful mode.](https://github.com/YaLTeR/niri/assets/1794388/b64e96c4-a0bb-4316-94a0-ff445d4c7da7) @@ -17,11 +18,24 @@ This way you can manage X11 windows inside the Xwayland instance. With fullscreen game inside a fullscreen Xwayland you get pretty much a normal gaming experience. +> [!TIP] +> If you don't run an X11 window manager, Xwayland will close and re-open its window every time all X11 windows close and a new one opens. +> To prevent this, start an X11 WM inside as mentioned above, or open some other long-running X11 window. + One caveat is that currently rootful Xwayland doesn't seem to share clipboard with the compositor. For textual data you can do it manually using [wl-clipboard](https://github.com/bugaevc/wl-clipboard), for example: - `env DISPLAY=:0 xsel -ob | wl-copy` to copy from Xwayland to niri clipboard -- `wl-paste | env DISPLAY=:0 xsel -ib` to copy from niri to Xwayland clipboard +- `wl-paste -n | env DISPLAY=:0 xsel -ib` to copy from niri to Xwayland clipboard + +You can also bind these to hotkeys if you want: + +``` +binds { + Mod+Shift+C { spawn "sh" "-c" "env DISPLAY=:0 xsel -ob | wl-copy"; } + Mod+Shift+V { spawn "sh" "-c" "wl-paste -n | env DISPLAY=:0 xsel -ib"; } +} +``` ## Using the Cage Wayland compositor @@ -45,4 +59,4 @@ Comment=Access all of your favorite music Icon=com.spotify.Client Exec=cage -- flatpak run com.spotify.Client Terminal=false -``` \ No newline at end of file +``` -- cgit