As a recent enthusiast of custom-built split keyboards, such as the Lily58, I’ve discovered that there is a space between left-right parts, and it just suitable to pair them with a touchpad enhances the user experience significantly. With an Apple Magictrackpad at my disposal, I embarked on a journey to replicate the seamless touchpad experience of macOS on Archlinux.
My initial approach was to utilize xinput, which yielded functional results, albeit not as fluid as I had hoped, such as moving too slow. Persistent in my search for a better solution, I turned to mtrack, a driver known for its support of advanced features, such as pinch gestures.
Starting off with the default mtrack
configuration, I added the following to my setup:
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
EndSection
However, this did not immediately activate my touchpad. It was after persuing the log file at $HOME/.local/share/xorg/Xorg.0.log
and identifying an error that I realized an additional line was necessary:
MatchDevicePath "/dev/input/event*"
With this amendment, it works now.
The next chapter involved fine-tuning parameters to better suit my environment. Here’s a glimpse of my tailored configuration:
Option "Sensitivity" "0.3"
Option "FingerHigh" "5"
Option "FingerLow" "1"
Option "IgnoreThumb" "true"
Option "IgnorePalm" "true"
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "TapButton4" "0"
Option "ClickFinger1" "1"
Option "ClickFinger2" "3"
Option "ClickFinger3" "2"
Option "ButtonMoveEmulate" "false"
Option "ButtonIntegrated" "true"
Option "SwipeLeftButton" "8"
Option "SwipeRightButton" "9"
Option "SwipeUpButton" "10"
Option "SwipeDownButton" "11"
Option "SwipeDistance" "500"
Option "ScrollDistance" "250"
Option "ScrollUpButton" "5"
Option "ScrollDownButton" "4"
Option "ScrollLeftButton" "7"
Option "ScrollRightButton" "6"
Option "ScrollCoastDuration" "300"
Option "ScrollCoastEnableSpeed" "0.1"
Option "ScrollCoastNoBoost" "true"
Option "ScrollCoastEase" "true"
Option "ScrollClickTime" "5"
Option "ScaleDistance" "300"
For further insights and refinements, I found this article particularly informative.
The final touch to my setup involved installing xdotool
and xbindkeys
, allowing me to map pinch gestures for zooming in and out, as well as utilizing three-fingers swipes to adjust volume.
"xdotool key ctrl+21"
b:12
"xdotool key ctrl+20"
b:13
"xdotool key XF86AudioRaiseVolume"
b:10
"xdotool key XF86AudioLowerVolume"
b:11