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+.
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
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
To build and install the deb yourself:
./build-deb.sh
sudo dpkg -i magicmouse-hid_2.1.0-0.deb
To reload the driver:
sudo rmmod hid_magicmouse
sudo modprobe hid_magicmouse
sudo ./remove.sh
sudo dpkg -r magicmouse-hid
For better responsibility, specially multi touch gestures, libinput parameters need to be implemented. More information can be found here.
To configure the Apple Magic Trackpad Parameters for libinput create quirks file /usr/share/libinput/local-overrides.quirks
with following content:
[Apple Magic Trackpad USB C Bluetooth]
MatchBus=bluetooth
MatchVendor=0x004C
MatchProduct=0x0324
AttrTouchSizeRange=20:10
AttrPressureRange=3:0
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
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 ]
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.
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.
Support for the USB-C version of the Apple magic keyboard is not supported by the project because it is a different driver. Upstream support can be found here.
This driver is based on the work of @SeDi343, @RicardoEPRodrigues, @robotrovsky, @svartalf, @0xABAD, and others. Thank you!