summary refs log tree commit diff stats
path: root/bin/touchpad_enable_tap.sh
blob: d4ac1cb53b99017eedcf3f37f99a3e542619066b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -eu

# This enables tapping, like tap-to-click, on the Thinkpad T14s Gen2 AMD.
# The touchpad ID changes between reboots sometimes.
#
# We need property 318, "Tapping Enabled".
# Available properties viewable with:
#       xinput list-props $TOUCHPAD_ID
#
# Requires:
#       xinput, libinput

TOUCHPAD_ID="$(xinput | grep Touchpad | awk '{print $6}' | cut -d'=' -f2)"
TAPPING_PROP_ID="$(xinput list-props 14 | grep 'Tapping Enabled (' | cut -d'(' -f2 | cut -d')' -f1)"

printf 'Touchpad ID:\t%s\n' "$TOUCHPAD_ID"
printf 'Tapping Prop:\t%s\n' "$TAPPING_PROP_ID"

/usr/bin/xinput set-prop "$TOUCHPAD_ID" "$TAPPING_PROP_ID" 1

printf '\n...Tapping Enabled\n'