Design a site like this with WordPress.com
Get started

Wayland/X11: How to run Firefox in mixed environment

running

Mixed X11/Wayland environment is a source of great annoyance when comes to running Firefox on Wayland along other X11 applications, like terminal, mail clients etc. Some X11 applications set GDK_BACKEND variable to x11 which effectively breaks Wayland applications and causes Firefox to start in X11 mode. That breaks Firefox remote protocol when Firefox searches for running instances and tries to reuse it.

When Firefox instance is already running on Wayland and you launch X11 version you get infamous “Firefox is already running” dialog due to locked Firefox profile.

Firefox 74 ships new MOZ_DBUS_REMOTE env variable and it forces Firefox on X11 to use D-Bus remote protocol as well as Wayland version does. So when X11 Firefox is launched after Wayland one with the same profile, already running Wayland instance is reused to open the link instead of the “Close Firefox” greetings.

All you need is to put this line to your ~/.bashrc file and restart your shell:

export MOZ_DBUS_REMOTE = 1

7 thoughts on “Wayland/X11: How to run Firefox in mixed environment

  1. Why isn’t MOZ_DBUS_REMOTE the default? Have bugs been filed against those applications that set GDK_BACKEND *and* can be used to spawn other apps?

    Like

  2. I run fish as my default shell. I tried export MOZ_DBUS_REMOTE=1 in my both my bashrc and fish.config.

    Putting MOZ_DBUS_REMOTE=1 and MOZ_ENALBE_WAYLAND=1 in /etc/environment ultimately worked for me.

    Like

  3. Are these env variable still needed?

    Are they needed when running Wayland without X11 applications (example Sway without the Xwayland layer)?

    thanks!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: