Skip to content

Driver for the 2024 Apple Magic Trackpad with USB-C support

Notifications You must be signed in to change notification settings

mr-cal/Linux-Magic-Trackpad-2-USB-C-Driver

 
 

Repository files navigation

Linux Apple Magic USB-C Driver

Driver support for the 2024 USB-C versions of the Magic Trackpad 2 and Magic Mouse 2.

Upstream support

A kernel patch for the trackpad has been accepted and backported to LTS kernels. It's available in:

  • 6.1 LTS - 6.1.120 and newer
  • 6.6 LTS - 6.6.66 and newer
  • 6.12 LTS - 6.12.5 and newer
  • 6.13 and newer

This is not needed for Apple Magic devices with lightning port connectors, which are supported in kernel version 5.15+.

Install

dkms

To install the driver on non-debian distros, install dkms and use the installer script:

sudo apt install dkms # or yum, pacman, etc
git clone https://github.com/mr-cal/Linux-Magic-Trackpad-2-USB-C-Driver.git
cd Linux-Magic-Trackpad-2-USB-C-Driver
chmod u+x install.sh
sudo ./install.sh

Github release

For Debian, Ubuntu, and derivatives, you can download and install the published deb package here and install it with:

wget https://github.com/mr-cal/Linux-Magic-Trackpad-2-USB-C-Driver/releases/download/latest/magicmouse-hid_2.1.0-0.deb
sudo dpkg -i magicmouse-hid_2.1.0-0.deb

Build a deb

To build and install the deb yourself:

./build-deb.sh
sudo dpkg -i magicmouse-hid_2.1.0-0.deb

Reload

To reload the driver:

sudo rmmod hid_magicmouse
sudo modprobe hid_magicmouse

Uninstall

DKMS

sudo ./remove.sh

Deb package

sudo dpkg -r magicmouse-hid

Data Layout of Trackpad

x: are x position of touch on touch surface
y: are y position of touch on touch surface
s: are state
touch_major: touch major axis of ellipse of finger detected
touch_minor: touch minor axis of ellipse of finger detected
size: size info
pressure: pressure of touch on touch surface
o: orientation of the touch on touch surface
i: id of touch
?: Unknown data
[ x x x x x x x x ]
[ y y y x x x x x ]
[ y y y y y y y y ]
[ s s ? ? ? ? y y ]
[ touch_major     ]
[ touch_minor     ]
[ size            ]
[ pressure        ]
[ o o o ? i i i i ]

Wayland and X11

The out-of-box experience with Magic Trackpads is significantly better with Wayland compared to X11.

setup usual default featureset
no driver point, hard left click
driver + X11 point, hard left/right clicks, scroll, three-finger middle mouse button
driver + wayland point, hard/soft left/right clicks, smooth scroll, zoom, three-finger middle mouse button

Additional gestures can be configured with touchegg or libinput-gestures.

Secure boot

If you haven't installed an unofficial driver before, be advised that you must disable secure boot, use a kernel that does not require signed drivers, or self-sign the driver. See here for more information.

Thanks

This driver is based on the work of @RicardoEPRodrigues, @robotrovsky, @svartalf, @0xABAD, and probably others. Thank you!

About

Driver for the 2024 Apple Magic Trackpad with USB-C support

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 98.4%
  • Shell 1.5%
  • Makefile 0.1%