Enabling Swipe Gestures in Chrome and Firefox on Linux with Wayland
Swipe gestures can greatly enhance your browsing efficiency by allowing easy navigation through your browser history. Below is how you can enable these gestures in both Google Chrome and Mozilla Firefox when running on Linux with the Wayland display server.
Google Chrome
Step 1: Ensure Chrome is Running on Wayland
Before enabling gesture-based navigation, first make sure that Chrome is using Wayland for its graphical output.
- Modify Chrome’s Launch Parameters: Add specific parameters to Chrome’s launch command to enable Wayland support:
- Copy the existing desktop entry for Chrome to your local directory:
cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/
- Open the copied file in a text editor
nano ~/.local/share/applications/google-chrome.desktop
- Add the Wayland flags to the
Exec=
lines:
Exec=/usr/bin/google-chrome-stable %U --enable-features=UseOzonePlatform --ozone-platform=wayland
- Save your changes and restart Chrome from this launcher.
- Verify Wayland Usage:
After starting Chrome, navigate to
chrome://gpu
to check that “Native GpuMemoryBuffers” are being used under “Graphics Feature Status,” confirming Wayland support.
Step 2: Enable Touchpad Overscroll History Navigation
Now, enable the gesture navigation feature in Chrome:
- Edit the previously modified
.desktop
entry again, appending another feature flag: Exec=/usr/bin/google-chrome-stable %U --enable-features=UseOzonePlatform,TouchpadOverscrollHistoryNavigation --ozone-platform=wayland
- Restart Chrome for the changes to take effect.
Mozilla Firefox
Enabling Wayland and Gesture Support in Firefox:
With Firefox 106 and above, you can directly enable swipe gestures for navigation without additional tools or extensions if you are using Wayland.
- Set the Environment Variable:
Ensure Firefox is running on Wayland by setting the
MOZ_ENABLE_WAYLAND
environment variable. - For a single user, add this to your
.profile
: echo "export MOZ_ENABLE_WAYLAND=1" >> ~/.profile
- Alternatively, modify the Firefox desktop entry:
cp /usr/share/applications/firefox.desktop ~/.local/share/applications/ nano ~/.local/share/applications/firefox.desktop
- Modify the
Exec=
line: Exec=env MOZ_ENABLE_WAYLAND=1 firefox %u
- Restart Firefox from the modified launcher or log out and then log back in to apply the changes.
- Enable Gesture Navigation: From Firefox 105 onwards, you can use horizontal swipes with two finger to navigate back and forward in your browsing history. Test the gestures to ensure they are working as expected.
Conclusion
Enabling gesture navigation in Chrome and Firefox on Linux using Wayland enhances your browsing experience by allowing quick and intuitive history navigation. This guide helps you set up your environment correctly to take advantage of these features, leveraging the full potential of your modern Linux setup.