Hi! This is a guide of how to use the Apple Magic Trackpad in Qubes OS, and is specially meant for people like me who suffer from carpan tunnel.
It looks like touchpads and very thin keyboards are the only thing that save me from suffering this Wizard Wrist pain.
I really hate Apple, but I must admit that their Magic Trackpad worked incredibly well in their operating system. And, although I am one of those that hates touchpads, I have to say that the Apple Magic Trackpad is so well designed that I even prefer it over mouses.
I began my journey in Qubes OS a little bit more than 2 months ago. I migrated from the Apple Ecosystem. When I entered the Apple Ecosystem, I had a very problematic carpan tunnel syndrome. I had to use the left hand for the mouse.
Although I prefer my right hand, I am ambidextrous so it isn’t that a big deal right? Well, it turns out that my left hand won’t be free of this disease, so I will have this horrendous pain in both wrists. This sucks.
When I tried the Apple Magic Trackpad, hoping for my disease to disappear, IT WORKED. I mean, you can probably use a Logitech touchpad and you will also be fine. But I bought the Apple one because I was a very hardcore Apple fanboy (I bought TONS of different devices from them).
Using a touchpad results in my wrists not having that tension in the tendons or whatever suffers from that unnatural hand position, so I can continue hacking for hours and hours and hours. I cannot play more shooters or LoL tho…
So, if you have the same issue as me, I highly recommend you buying a touchpad (or if you use a laptop, stick to it).
In this tutorial, I will show you how I am setting up my Apple Magic Trackpad.
I don’t know if other different models differ from my config because I have never felt the need to replace this wonderful touchpad.
Also, this is my current config, but I will keep posting here more upgrades as I continue to upgrade my User eXperience until I reach something similar to macOS.
Man, the only thing I envy from Apple is their wonderful touchpad integration and their incredible battery life of their laptops. Hopefully in a future we have an ARM based QubesOS iso :c (IMHO more priority than Qubes Air, just sayin, dont get mad with me pls)
Okay, let’s start! First of all, I have to give @vxc credits for his solve at this post for pointing out those 2 files and the libinput thing.
I didn’t like the lack of detail of his solve, so this is the purpose of this post.
Let’s get this touchpad going:
- I first enabled trackpad going to the “Qubes Global Config” > “USB devices” > “Touchscreen/Tablet” > “enable”
- Then, in dom0 we install libinput-utils:
sudo qubes-dom0-update libinput-utils - Then, we list the trackpad in dom0:
sudo libinput list-devicesand the result is this:
Device: sys-usb: Apple Inc. Magic Trackpad
Kernel: /dev/input/event15
Group: 9
Seat: seat0, default
Size: 162x115mm
Capabilities: pointer gesture
Tap-to-click: disabled
Tap-and-drag: enabled
Tap drag lock: disabled
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: disabled
Calibration: n/a
Scroll methods: *two-finger edge
Click methods: *button-areas clickfinger
Disable-w-typing: enabled
Disable-w-trackpointing: enabled
Accel profiles: flat *adaptive
Rotation: n/a
Device: sys-usb: Apple Inc. Magic Trackpad
Kernel: /dev/input/event16
Group: 10
Seat: seat0, default
Size: 162x115mm
Capabilities: pointer gesture
Tap-to-click: disabled
Tap-and-drag: enabled
Tap drag lock: disabled
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: disabled
Calibration: n/a
Scroll methods: *two-finger edge
Click methods: *button-areas clickfinger
Disable-w-typing: enabled
Disable-w-trackpointing: enabled
Accel profiles: flat *adaptive
Rotation: n/a
As you can see in this line “Device: sys-usb: Apple Inc. Magic Trackpad”, this is my model.
You may have this one: “Device: sys-usb: Apple Inc. Magic Trackpad 2”. Keep that in mind.
- Last, config the 2 files shown by @vxc. I’m writing this data:
/etc/X11/xorg.conf.d/30-touchpad.conf:
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
#Option "ClickMethod" "clickpad"
#Option "ClickMethod" "buttonareas"
#Option "ButtonMapping" "1 2 3" # Optional: 1=left, 2=middle (3-finger), 3=right (2-finger)
Option "Tapping" "on"
Option "TappingButtonMap" "lrm"
Option "NaturalScrolling" "true"
Option "ScrollPixelDistance" "20"
EndSection
Each field does the following:
Identifier "touchpad": This config affects touchpadsDriver "libinput": This config uses libinputMatchIsTouchpad "on": Only apply this to touchpadsOption "Tapping" "on": I enable tapping because I like doing effortless clicks. This requires less surface pressure, therefore less wrist/fingers pain/fatigue. But I know that lots of you hate it. Disable it then with “off”.Option "TappingButtonMap" "lrm"enables the following: 1 finger tap = left click | 2 finger tap = right click | 3 finger tap = middle clickOption "NaturalScrolling" "true": Scrolling down moves you up and viceversa, just like touchpads and touchscreens are intended to be usedOption "ScrollPixelDistance" "20": This is me trying to have a scroll that scrolls smoothly like in a macbook, instead of a scroll that scrolls 3 lines per scroll unit, like in a mouse wheel. It doesn’t seem to work well tho… Needs to be fixed- Ignore the commented lines, are not-finished experiments
/etc/libinput/local-overrides.quirks:
[Magic Trackpad pressure]
MatchUdevType=touchpad
MatchName=*Magic Trackpad
AttrPressureRange=1:0
MatchUdevType=touchpadThis is a touchpad configMatchName=*Magic TrackpadThis config affects any touchpad which its name ends in “Magic Trackpad”- If your model was “Device: sys-usb: Apple Inc. Magic Trackpad 2”, replace it for
MatchName=*Magic Trackpad 2
- If your model was “Device: sys-usb: Apple Inc. Magic Trackpad 2”, replace it for
AttrPressureRange=1:0Cursor movement starts when minimum pressure (1) is applied. Cursor movement stops when no pressure is applied (0)- I set up this sensitivity because i dont like pressuring the touchpad while moving my cursor. It’s a burden. I prefer effortless and no-friction UX.
- Reboot and everything will apply. For the moment, this is everything I’ve done.
TODO:
- Make the scroll smoother, so it doesn’t behave like a mouse scroll that scrolls 3 terminal lines per scroll-unit. It MUST scroll smoothly like in a macOS or an iPhone, and this MUST work in every app opened in order to extremely increase user experience.
- Add inertia to the scroll, so it keeps scrolling after you slide up or down for a moment until it stops completely (like in iPhones or a macBook) (stopabble by stepping one or more fingers in the touchpad). I guess we have to wait until the devs are able to port Qubes to Wayland. Anyways I will keep investigating about it.
- For some reason, if you try to click and drag something (like moving a window) with a lot of pressure, the cursor will freeze. I’m trying to fix this. You will encounter this issue, at the moment you can try to move windows or select text by applying low pressure to your click or doing so by tapping (will always work)
- Add the 3 finger gesture to move between desktops like in macOS
Cool things:
- You can use the 3 finger tap to paste anything you’ve selected. This is an ultra-fast-way to paste things into the terminal.
- You can move windows of apps opened in your desktop to the bottom by 3-finger-tapping their title bar. This is cool because it saves you a lot of 1-finger-taps/left-clicks bringing to the top the rest of windows you wanna focus.
Help me:
- You can debug touchpad pressure and behaviour by running in dom0 this command:
sudo libinput measure touchpad-pressure