Artix Linux Forum

Artix Linux => Package management => AUR Packages => Topic started by: xanadu on 09 June 2021, 09:52:09

Title: Firefox with Wayland from Fedora
Post by: xanadu on 09 June 2021, 09:52:09
For those using Firefox under GNOME with Wayland I recommend the build from Fedora since it has Wayland activated by default. Certain glitches that do occur under XWayland will be gone. Unfortunately the maintainers of the PKGBUILD didn't update it for a while, so I posted an updated version in the comment section below:
https://aur.archlinux.org/packages/fedora-firefox-wayland-bin (https://aur.archlinux.org/packages/fedora-firefox-wayland-bin)
Title: Re: Firefox with Wayland from Fedora
Post by: Dudemanguy on 09 June 2021, 14:59:43
You've been able to run Firefox with wayland by using MOZ_ENABLE_WAYLAND=1 for about a couple of years now. Maybe even longer. I forgot when that was introduced.
Title: Re: Firefox with Wayland from Fedora
Post by: xanadu on 09 June 2021, 17:19:21
You've been able to run Firefox with wayland by using MOZ_ENABLE_WAYLAND=1 for about a couple of years now. Maybe even longer. I forgot when that was introduced.
Indeed, but as far as I know, in GNOME with Wayland, there is no convenient way to set environment variables permanently and in addition, the build from Fedora has some other optimizations for GNOME.
Title: Re: Firefox with Wayland from Fedora
Post by: strajder on 09 June 2021, 17:25:03
Indeed, but as far as I know, in GNOME with Wayland, there is no convenient way to set environment variables permanently
Have you tried putting the export commands in your ~/.profile, ~/.bash_profile or ~/.bashrc?
Title: Re: Firefox with Wayland from Fedora
Post by: xanadu on 09 June 2021, 19:51:59
Have you tried putting the export commands in your ~/.profile, ~/.bash_profile or ~/.bashrc?
If I remember right, I tried it and it didn't work in modern versions of GNOME. Some environment variables can be set with systemd, but not all of them:
https://noah.meyerhans.us/2020/07/07/setting-environment-variables-for-gnome-session/ (https://noah.meyerhans.us/2020/07/07/setting-environment-variables-for-gnome-session/)
Title: Re: Firefox with Wayland from Fedora
Post by: Dudemanguy on 09 June 2021, 20:32:32
Not sure how it works with display managers, but I always just log into tty first. That way anything from my bashrc/zshrc whatever gets exported to the shell.
Title: Re: Firefox with Wayland from Fedora
Post by: strajder on 10 June 2021, 01:10:11
Didn't know that new GNOME bypasses reading the startup files. Well, Wayland and GNOME suck then. Going towards Windowsification along with systemd.

That's why I use DM-less Xorg + dwm + st.

For a (completely cumbersome) workaround, see here (found by web search): https://unix.stackexchange.com/a/326161

Edit: You could also make a copy of Firefox's desktop file which calls a script, and call env MOZ_ENABLE_WAYLAND=1 /usr/bin/firefox inside that script. This wouldn't set that variable system-wide, but only for the started process.
Title: Re: Firefox with Wayland from Fedora
Post by: xanadu on 10 June 2021, 08:26:20
Edit: You could also make a copy of Firefox's desktop file which calls a script, and call env MOZ_ENABLE_WAYLAND=1 /usr/bin/firefox inside that script. This wouldn't set that variable system-wide, but only for the started process.
I tried this, but it didn't work well, since the env is injected only when firefox is started through the desktop file. When you cklick onto a link in another application, it does of course not work. Under GNOME it's just not meant to be.
Title: Re: Firefox with Wayland from Fedora
Post by: strajder on 10 June 2021, 08:48:38
When you cklick onto a link in another application, it does of course not work.
You also have to edit ~/.config/mimeapps.list to redirect all things handled by Firefox's desktop file to the new desktop file calling the script.

For example, I have
Code: [Select]
text/markdown=mdv.desktop
image/jpg=imv.desktop
text/x-diff=less.desktop
text/plain=less.desktop
text/gemini=lagrange.desktop
text/html=surf.desktop
text/xml=surf.desktop
x-scheme-handler/http=surf.desktop
x-scheme-handler/https=surf.desktop
x-scheme-handler/about=surf.desktop
x-scheme-handler/ftp=surf.desktop
x-scheme-handler/unknown=surf.desktop
x-scheme-handler/gemini=lagrange.desktop
x-scheme-handler/gopher=lagrange.desktop
Title: Re: Firefox with Wayland from Fedora
Post by: xanadu on 12 June 2021, 18:41:28
There is actually a solution that works with GNOME:

Adding MOZ_ENABLE_WAYLAND=1 to /etc/environment.