Skip to content

Instantly share code, notes, and snippets.

@ivan
Last active November 25, 2017 12:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivan/c35e798d4f32e37c1714ec5beec30d16 to your computer and use it in GitHub Desktop.
Save ivan/c35e798d4f32e37c1714ec5beec30d16 to your computer and use it in GitHub Desktop.
Acceptable touchpad settings for Linux / xorg that make precise movement easier
# Inspired by https://www.x.org/wiki/Development/Documentation/PointerAccelerationAsOf16/
# See http://who-t.blogspot.com/2016/09/synaptics-pointer-acceleration.html for synaptics insanity
Section "InputClass"
Identifier "touchpad"
# Use synaptics because libinput is broken: it fails to initiate cursor
# movement when touching starts at some edges and corners, and it makes
# assumptions about whether we need palm and thumb detection based
# on the size of our touchpad. I was unable to fix these issues by
# patching libinput to disable palm/thumb detection and the horizontal
# scrolling area.
Driver "synaptics"
MatchIsTouchpad "on"
# xorg already has mouse acceleration ("pointer feedback"), so don't
# let synaptics change speed.
Option "MinSpeed" "1.0"
Option "MaxSpeed" "1.0"
# Default is 200/((WIDTH**2+HEIGHT**2)**0.5) and it may be better not
# to mess with AccelFactor.
# Option "AccelFactor" "0.03"
# synaptics is too sensitive in general and MinSpeed=1.0 MaxSpeed=1.0
# makes it worse, so use ConstantDeceleration (this is just a divisor!)
# to slow it down to make precise movement possible.
#
# See also https://bugs.freedesktop.org/show_bug.cgi?id=38998
# ("Synaptics driver imposes minimum speed")
Option "ConstantDeceleration" "3"
# We've slowed down the cursor quite a bit, so we need more than the
# default acceleration of 2/1 to move it across the screen; add this
# to ~/.xinitrc:
#
# xset m 4/1 0
#
# If your screen is big (these parameters were tested on 13" 1600x900),
# you may need to increase the acceleration or decrease the
# ConstantDeceleration so that you can flick the cursor across the screen.
# Adjust based on whether you have physical touchpad buttons, etc.
Option "TapButton1" "1"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "VertTwoFingerScroll" "0"
Option "HorizTwoFingerScroll" "0"
Option "VertEdgeScroll" "1"
Option "CoastingSpeed" "20"
Option "CornerCoasting" "0"
Option "CircularScrolling" "0"
Option "EdgeMotionUseAlways" "0"
EndSection
@ivan
Copy link
Author

ivan commented Nov 25, 2017

You can check that the proper acceleration was applied with xinput:

xinput get-feedbacks "SynPS/2 Synaptics TouchPad"

(It may be overridden by a desktop environment e.g. xfce4, so you may need to rm ~/.config/xfce4/xfconf/xfce-perchannel-xml/pointers.xml or configure the acceleration in the desktop environment.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment