Tips of XWayland with Sway?

I am using both Sway on Wayland, and i3 (X-Window based) in some cases on Fedora 36 on Framework Laptop. Recently I knew XWayland on the Framework community’s thread, and I consider using it. Because Firefox sometimes aborts silently, and I saw issues on Gimp (gimp), and Freeplane (freeplane) on Sway.

I am trying to find how to set up and the tips to use the XWayland. Are you using XWayland? How did you install it? What are the tips?

For the installation, the command below is enough?

$ sudo dnf install xorg-x11-server-Xwayland

Related documents I found:

As far as I know xwayland is installed by default with Fedora’s sway.

Is there something in particular you are trying to accomplish?

sudo dnf info firefox-wayland

You might have just to install this and run firefox with firefox-wayland link ?

xorg-x11-server-Xwayland is a dependency of sway package so it will be installed automatically when you install sway on Fedora. You can set and export MOZ_ENABLE_WAYLAND environment variable to make firefox use wayland instead of Xwayland.

1 Like

Guys, thanks for your helps!

No, I am just trying to use Sway normally.

I noticed I already have the installed xorg-x11-server-Xwayland package. :sweat_smile: As I saw the example of installing Sway and Xwayland separately in Ubuntu, I misunderstood that Xwayland was not installed on my local environment.

Here is my current status on my local environment.

$ rpm -q sway
sway-1.7-4.fc36.x86_64

$ rpm -qR sway | grep -i xwayland
xorg-x11-server-Xwayland

$ rpm -q xorg-x11-server-Xwayland
xorg-x11-server-Xwayland-22.1.5-1.fc36.x86_64

$ rpm -q firefox-wayland
package firefox-wayland is not installed

Thanks. There is no installed firefox-wayland package on my local environment. And I didn’t know it is required to run Firefox on Wayland. I will try it.

You are right. I noticed the
xorg-x11-server-Xwayland was already installed on my local environment. :sweat_smile:

I didn’t know the environment variable. Is it essential to run Firefox on Sway? I am still not sure about the behaviors of the environment variable and the firefox-wayland package.

1 Like

Now I found what these things are.

$ sudo dnf install firefox-wayland

$ rpm -q firefox-wayland
firefox-wayland-108.0.1-3.fc36.x86_64

$ rpm -ql firefox-wayland
/usr/bin/firefox-wayland
/usr/share/applications/firefox-wayland.desktop

$ file /usr/bin/firefox-wayland
/usr/bin/firefox-wayland: Bourne-Again shell script, ASCII text executable
$ cat /usr/bin/firefox-wayland
#!/usr/bin/bash
#
# Run Firefox under Wayland
#

export MOZ_ENABLE_WAYLAND=1
exec /usr/bin/firefox "$@"
1 Like

I updated the following files for sway and i3 cases. :smile:

.bashrc

+# Wayland
+# https://wiki.archlinux.org/title/Wayland
+if [ "${XDG_SESSION_TYPE}" = wayland ]; then
+    export MOZ_ENABLE_WAYLAND=1
+    # For Gimp
+    export GDK_BACKEND=x11
+else
+    unset MOZ_ENABLE_WAYLAND
+    unset GDK_BACKEND
+fi
+

~/.config/sway/config

-set $browser firefox
+set $browser firefox-wayland
1 Like