Skip to main content

MacbookPro M1 with Asahi Linux: Fixing the touchpad

·584 words·3 mins· ·
Asahi Linux Macbookpro
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman
Table of Contents

I’m a big Linux fan. On my Ryzen 3700X desktop rig I run Arch Linux and I like it. The only times I boot into Windows are to play Rocksmith 2014, because I still haven’t got that game to work properly on Steam/Proton.

My job provides me with nice “developer laptop”, which has been a high-end MacbookPro ever since I started there in 2007. The current iteration is a well spec’ed 16" M1 Max.

I run Arch, BTW!
…and now also Fedora on aarch64, apparently.

Now, I’ve never had any qualm with macos. It was a breath of fresh air when Windows was the only viable desktop OS. It’s really polished but still has that BSD underpinning that makes it a breeze using it as a development machine.

On previous Intel Macs I tried installing Arch and Ubuntu a few times, but always ran into unsupported hardware. Each time I gave up pretty quickly and accepted the fact that Apple hardware and macos are married.

Then a co-worker told me about his success in running Asahi Linux on his M1 machine. I had to try.

Although this is not a review of Asahi Linux: it’s amazing! There are a few quirks, as is expected, but nothing that is a real deal breaker.

In this post I want to address my issues with the trackpad and how I solved them.

Accidental tapping
#

Touchpads are great, just not when they register taps when you’re typing and shift focus to the most ungodly places. When you palms touch the touchpad, they can register ghost taps. With the MacbookPro’s touchpad being so huge, that’s quite a high risk.

The solution to this problem is quite easily fixed with some settings in GNOME.

First, Disable Touchpad While Typing. It will not completely fix the tapping issue, but it’s a great help. You find this in GNOME Settings -> Mouse & Touchpad and then the Touchpad tab.

Disable trackpad while typing

Next, scroll down a bit and disable Tap to Click. You know with touchpads, where you can either click on it (it makes that clicking sound), or just tap it, like you would your phone. Well, this option turns of that tapping behaviour.

Disable Tap to Click

Fixing trackpad scroll speed
#

This is by far the most annoying problem. The scroll speed. It feels like the trackpad is on cocaine or something.

Unfortunately, GNOME cannot help us out here, because it simply does not have a setting for it. Long story short, GNOME is pointing to Wayland’s libinput to fix this problem, and libinput is pointing to windows managers (like GNOME) to handle it.

Luckily, there’s some great people out there who created kind-of-a-hack for libinput to allow scaling the scroll-speed.

You can find that code here: warningnonpotablewater/libinput-config.

Warning: Non-Potable Water / libinput-config

Configuration system for libinput

102
11

Here’s a quick rundown of how to install it:

  1. Install dependencies first: sudo dnf install meson ninja-build cmake libinput-devel
  2. Clone that repo: git clone https://gitlab.com/warningnonpotablewater/libinput-config.git
  3. meson build then, go into the build/ directory.
  4. ninja && sudo ninja install to build and install the library.

Then, all you need to is create a config file in /etc/libinput.conf and reboot.

# /etc/libinput.conf

scroll-factor=0.5

In this case, the scrolling was too fast, so I multiply it with a factor of 0.5 to bring it down. You may want to try some other values if you’re not satisfied with the result.

If you want faster scrolling, use a factor >1.

Simply reboot your machine for the changes to take effect.

Related

Arch Linux: Improve boot time performance
·851 words·4 mins
Homelab Arch Linux
How to background a running process over SSH
·406 words·2 mins
Linux Freebsd Devops Bash Zsh