Skip to content

Instantly share code, notes, and snippets.

@joshskidmore
Created October 4, 2019 00:18
Show Gist options
  • Save joshskidmore/ef6d3c92f8b6ff3d89fefa2326b9b68a to your computer and use it in GitHub Desktop.
Save joshskidmore/ef6d3c92f8b6ff3d89fefa2326b9b68a to your computer and use it in GitHub Desktop.
synaptics.sh
#!/usr/bin/env bash
echo "Configuring synaptics settings..."
S=synclient
# [man] The LeftEdge, RightEdge, TopEdge and BottomEdge parameters are used to define the edge and corner
# areas of the touchpad. The parameters split the touchpad area in 9 pieces, like this:
# │ │
# │ LeftEdge │ RightEdge
# ──────└─────────────└──── Physical top edge
# │ 1 │ 2 │ 3 │
# └─────└─────────────└───┘ TopEdge
# │ │ │ │
# │ 4 │ 5 │ 6 │
# │ │ │ │
# └─────└─────────────└───┘ BottomEdge
# │ 7 │ 8 │ 9 │
# └─────└─────────────└───┘ Physical bottom edge
# │Physical left edge │ Physical right edge
# Coordinates to the left of LeftEdge are part of the left edge (areas 1, 4 and 7), coordinates to
# the left of LeftEdge and above TopEdge (area 1) are part of the upper left corner, etc.
# A good way to find appropriate edge parameters is to use evtest(1) on the device to see the
# x/y coordinates corresponding to different positions on the touchpad.
# The perceived physical edges may be adjusted with the AreaLeftEdge, AreaRightEdge, AreaTopEdge,
# and AreaBottomEdge options. If these values are set to something other than the physical edges,
# input that starts in the space between the area edge and the respective physical edge is ignored.
# Note that this reduces the available space on the touchpad to start motions in.
# -- tl;dr --
# for LeftEdge/RightEdge, use `evtest | grep -i ABS_X` (type touchpad event id) and tap the left/right
# areas of the touchpad; use the average of those numbers as LeftEdge/RightEdge
# same is true for TopEdge/BottomEdge, except use `evtest | grep -i ABS_Y`
#$S LeftEdge=0
#$S RightEdge=1215
#$S TopEdge=0
#$S BottomEdge=680
$S AreaLeftEdge=0
$S AreaTopEdge=0
$S AreaRightEdge=1024
$S BottomEdge=740
# [man] A tap event happens when the finger is touched and released in a time interval shorter than MaxTapTime,
# and the touch and release coordinates are less than MaxTapMove units apart. A "touch" event happens when
# the Z value goes above FingerHigh, and an "untouch" event happens when the Z value goes below FingerLow.
#$S FingerLow=10
#$S FingerHigh=12
#$S MaxTapTime=140
#$S MaxTapMove=20
#$S ClickTime=5
#$S SingleTapTimeout=70
#$S MaxDoubleTapTime=140
# remember in 2002 when touchpads had those side scroll bars. yeah, disable that shit.
$S VertEdgeScroll=0
$S HorizEdgeScroll=0
$S CornerCoasting=0
# disable all taps except two finger "right click"
$S TapButton1=1 #1
$S TapButton2=3 #3
$S TapButton3=0
# osx-like natural / reverse scrolling
$S VertScrollDelta=-40
$S HorizScrollDelta=-60
$S HorizTwoFingerScroll=1
$S VertTwoFingerScroll=1
# [man] The MinSpeed, MaxSpeed and AccelFactor parameters control the pointer motion speed. The speed value defines
# the scaling between touchpad coordinates and screen coordinates. When moving the finger very slowly, the MinSpeed
# value is used, when moving very fast the MaxSpeed value is used. When moving the finger at moderate speed, you get
# a pointer motion speed somewhere between MinSpeed and MaxSpeed. If you don't want any acceleration, set MinSpeed
# and MaxSpeed to the same value.
# The MinSpeed, MaxSpeed and AccelFactor parameters don't have any effect on scrolling speed. Scrolling speed is
# determined solely from the VertScrollDelta and HorizScrollDelta parameters. To invert the direction of vertical
# or horizontal scrolling, set VertScrollDelta or HorizScrollDelta to a negative value.
$S MinSpeed=0.45 # 0.3
$S MaxSpeed=1.3 # 1
$S AccelFactor=0.8 # 0.6
# palm detection is good. these are pretty conservative
$S PalmDetect=1
#$S PalmMinWidth=7
#$S PalmMinZ=25
# coasting is when you scroll up/down/left/right and let go
# CoastingSpeed: how much to coast
# CoastinFriction: how momentum applies to your coast movements
#$S CoastingSpeed=255
#$S CoastingFriction=0
# these settings control the difference between a two-finger scroll versus an intential single finger action
# i found the defaults were too low and liberal causing a lot of unintential vertical/horizontal scrolling
#$S EmulateTwoFingerMinZ=400
#$S EmulateTwoFingerMinW=15
#$S VertHysteresis=0
#$S HorizHysteresis=0
# [man] When pressure motion is activated, the cursor motion speed depends on the pressure exerted on the touchpad (the more pressure exerted on the touchpad, the faster the pointer). More precisely the speed is first calculated according to MinSpeed, MaxSpeed and AccelFactor, and then is multiplied by a sensitivity factor.
# The sensitivity factor can be adjusted using the PressureMotion parameters. If the pressure is below PressureMotionMinZ, PressureMotion‐
# MinFactor is used, and if the pressure is greater than PressureMotionMaxZ, PressureMotionMaxFactor is used. For a pressure value between
# PressureMotionMinZ and PressureMotionMaxZ, the factor is increased linearly.
#$S PressureMotionMinZ=5
#$S PressureMotionMaxZ=200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment