113 lines
3.4 KiB
Bash
Executable file
113 lines
3.4 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
tp_name="$(cat ~/.touchpad-name)"
|
|
|
|
if [ "$tp_name" != none ]; then
|
|
xinput set-prop "$tp_name" "libinput Natural Scrolling Enabled" 1
|
|
fi
|
|
|
|
if [ $# -eq 1 ]; then
|
|
display=$1
|
|
else
|
|
display="$(xrandr | awk '/primary/ { print $1 }')"
|
|
fi
|
|
|
|
# Required since 2019-03-12, beowulf
|
|
if xinput list | grep -q "TPPS/2 Elan TrackPoint"; then
|
|
xinput set-prop "TPPS/2 Elan TrackPoint" "libinput Accel Speed" -0.2
|
|
fi
|
|
|
|
# as on bridge/t490s
|
|
if xinput list | grep -q "Elan TrackPoint"; then
|
|
xinput set-prop "Elan TrackPoint" "libinput Accel Speed" -0.5
|
|
fi
|
|
|
|
# Not needed if using regular libinput
|
|
# if xinput list | grep -q "Elan Touchpad"; then
|
|
# xinput set-prop "Elan Touchpad" "Device Accel Constant Deceleration" 3
|
|
# fi
|
|
|
|
# blind
|
|
if xinput list | grep -q "Wacom HID 5276 Finger"; then
|
|
xinput map-to-output 'Wacom HID 5276 Finger' ${display}
|
|
xinput map-to-output 'Wacom HID 5276 Pen Pen (0x81266661)' ${display}
|
|
fi
|
|
|
|
# sun
|
|
if xinput list | grep -q "LXT2021:00 29BD:3201"; then
|
|
xinput map-to-output 'LXT2021:00 29BD:3201' ${display}
|
|
fi
|
|
if xinput list | grep -q "VEN_04F3:00 04F3:31D1 Touchpad"; then
|
|
xinput set-prop 'VEN_04F3:00 04F3:31D1 Touchpad' "Synaptics Palm Detection" 1
|
|
|
|
# 10, 200 by default
|
|
xinput set-prop 'VEN_04F3:00 04F3:31D1 Touchpad' 'Synaptics Palm Dimensions' 4 40
|
|
xinput set-prop 'VEN_04F3:00 04F3:31D1 Touchpad' 'Synaptics Two-Finger Scrolling' 1 1
|
|
fi
|
|
|
|
# nb2
|
|
if xinput list | grep -q "ELAN Touchscreen"; then
|
|
xinput map-to-output 'ELAN Touchscreen' ${display}
|
|
fi
|
|
|
|
if xinput list | grep -q Bamboo; then
|
|
devfinger="Wacom Bamboo 16FG 4x5 Finger touch"
|
|
|
|
xinput set-prop "$devfinger" "Device Enabled" 0
|
|
|
|
xsetwacom --set "Wacom Bamboo 16FG 4x5 Pen stylus" MapToOutput $display
|
|
xsetwacom --set "Wacom Bamboo 16FG 4x5 Pen eraser" MapToOutput $display
|
|
|
|
fi
|
|
|
|
case $(hostname) in
|
|
hike)
|
|
xrandr --output eDP1 --rotate right
|
|
xinput set-prop "pointer:Goodix Capacitive TouchScreen" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
|
|
|
|
# Make gnubbel behave ok
|
|
xinput set-prop 12 "libinput Accel Speed" -1
|
|
|
|
# Need to use us keyboard on this one
|
|
setxkbmap us
|
|
;;
|
|
nb1)
|
|
xinput set-prop "TPPS/2 IBM TrackPoint" "libinput Accel Speed" -0.5
|
|
;;
|
|
nb3)
|
|
xinput set-prop "ELAN0670:00 04F3:3150 Touchpad" "Synaptics Two-Finger Scrolling" 1 1
|
|
;;
|
|
blind)
|
|
# unused atm - 2025-03-16
|
|
# rotate-by-sensor.sh &
|
|
xinput set-prop "ELAN0672:00 04F3:3187 Touchpad" 'Synaptics Two-Finger Scrolling' 1 1
|
|
;;
|
|
mantel)
|
|
# Enable button 1 tap
|
|
xinput set-prop "SYNA0101:00 06CB:CFB0 Touchpad" "Synaptics Tap Action" 0 0 0 0 1 0 0
|
|
;;
|
|
esac
|
|
|
|
|
|
# Only continue if there is wacom stuff
|
|
if ! xinput list | grep -i wacom -q; then
|
|
exit 0
|
|
fi
|
|
|
|
|
|
|
|
# xinput set-prop "Wacom Bamboo 16FG 4x5 Finger pad" "Device Enabled" 0
|
|
|
|
xsetwacom --set "Wacom Bamboo 16FG 4x5 Pen stylus" mode relative
|
|
|
|
xinput set-prop "Wacom Bamboo 16FG 4x5 Pen stylus" "Device Accel Constant Deceleration" 4
|
|
xinput set-prop "Wacom Bamboo 16FG 4x5 Pen stylus" "Device Accel Adaptive Deceleration" 2
|
|
|
|
xsetwacom --set "Wacom HID 484D Finger touch" MapToOutput "$display"
|
|
xsetwacom --set "Wacom HID 484D Pen stylus" MapToOutput "$display"
|
|
|
|
# Rotate so usb cable is not disturbing me
|
|
# xinput set-prop 14 "Evdev Axis Inversion" 1 1
|
|
# xsetwacom --set "Wacom Bamboo 16FG 4x5 Pen" MapToOutput LVDS1
|
|
|
|
exit 0
|