Skip to content

Instantly share code, notes, and snippets.

@detherminal
Last active May 1, 2026 21:49
Show Gist options
  • Select an option

  • Save detherminal/1845c794ee3f3cdcc4e7eb713e9ee6fd to your computer and use it in GitHub Desktop.

Select an option

Save detherminal/1845c794ee3f3cdcc4e7eb713e9ee6fd to your computer and use it in GitHub Desktop.
Brave Browser Wayland Two (2) Finger Touchpad Gesture Swipe History Back And Forth Enabling
# To add two-finger gesture to back and forth swiping, follow this steps with shell
# 1 - Open .desktop file with nano
sudo nano /usr/share/applications/brave-browser.desktop
# 2 - Move to a little bottom, edit the place where it is `Exec=` to match this
Exec=/usr/bin/brave-browser-stable %U --ozone-platform=wayland --enable-features=TouchpadOverscrollHistoryNavigation
# Use `Ctrl-O` to write and `Ctrl-X` to exit
# Now restart the brave browser and you will be able to swipe back and forth with two-finger touchpad gestures.
@brootware

brootware commented May 29, 2024

Copy link
Copy Markdown

Thank you for this! Been searching online to enable this everywhere and this config worked. I've also made it in to ansible task for repeatability.

- name: Replace line in brave-browser.desktop file to enable 2 fingers swipe back and forth gesture. https://gist.github.com/detherminal/1845c794ee3f3cdcc4e7eb713e9ee6fd
      lineinfile:
        path: /usr/share/applications/brave-browser.desktop
        regexp: '^Exec=/usr/bin/brave-browser-stable %U$'
        line: 'Exec=/usr/bin/brave-browser-stable %U --ozone-platform=wayland --enable-features=TouchpadOverscrollHistoryNavigation'
      become: true

source - https://github.com/brootware/dotfiles/blob/e26ea30ba49977ec7540110980f6194c49cd786f/dotbootstrap/rpm_linux_setup.yml#L114

@aClue0

aClue0 commented Mar 17, 2026

Copy link
Copy Markdown

thank you this worked for me! but a little disclaimer, you have to change "brave-browser-stable" to your default exec command. For example mine was just Exec = brave %U so you replace "brave-browser-stable" with just "brave". you also have to replace every instance of Exec with it's own modified one.

@mrwh1t3n01z3

Copy link
Copy Markdown

it did not work on ubuntu (.deb) package

@chrispouliot

Copy link
Copy Markdown

You rock, I was trying to figure out why my Brave browser didnt support something so simple coming from a Firefox user. This worked perfectly on NixOS and I just had to edit my .desktop file. Cheers

@mrwh1t3n01z3

Copy link
Copy Markdown

i don't know what just happend but i tried it now an it worked thanks man 🥳

@aClue0

aClue0 commented Apr 28, 2026

Copy link
Copy Markdown

I have also found another solution for Arch Linux distros, or if you installed via FlatPak:
Arch Linux (AUR): The brave-bin or brave packages from the AUR ( yay -S brave-bin ) include a launcher script specifically designed to read ~/.config/brave-flags.conf .
Flatpak: The official Flatpak version (available on Flathub) is hardcoded to look for this file at ~/.var/app/com.brave.Browser/config/brave-flags.conf .

so if you nano/vim brave-flags.conf file (from the locations above) you can just add:

--ozone-platform=wayland
--enable-features=TouchpadOverscrollHistoryNavigation

and it works beautifully!

@Shihabus-Sakib-Rad

Copy link
Copy Markdown

this works on brave-origin as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment