The laptop is manjaro gnome, on it libinput is installed by default, which is very poorly configured (specifically, I could not adjust the scrolling speed on the touchpad, nor MOUSE_WHEEL_CLICK_ANGLE in /etc/udev/hwdb.d/ , nor Option "RotationAngle" .. in /etc/X11/xorg.conf.d/ do not give any result), so I put xf86-input-synaptics , threw my config into /etc/X11/xorg.conf.d/ , everything became normal, but did not work disabling the touchpad during keyboard input (syndaemon with libinput doesn't work, or I'm doing something wrong, because at some point syndaemon started working, but then stopped). In general, my question is whether in this situation it is possible to make either DisableWhileTyping work with the synaptics driver, or to somehow adjust the scrolling speed in libinput?
|
1 answer
In general, I did not find an adequate solution, so I had to hitch up such a one-liner:
TOUCHPAD_DEV_NAME="ETD2303:00 04F3:3083 Touchpad"; DISABLE_COMMAND="xinput set-prop '$TOUCHPAD_DEV_NAME' 'Synaptics Tap Action' 0 0 0 0 0 0 0"; ENABLE_COMMAND="xinput set-prop '$TOUCHPAD_DEV_NAME' 'Synaptics Tap Action' 0 3 0 0 1 3 2"; INTERVAL=0.2; PREV_SLEEP_PID=0; unbuffer libinput debug-events --show-keycodes | unbuffer -p grep --perl-regexp 'KEY_[0-9A-Z] \([0-9]+\) (pressed|released)' | while IFS='' read -r INPUT || [[ -n "$INPUT" ]]; do if [[ "$INPUT" =~ KEY_[0-9A-Z] ]]; then if [ ${PREV_SLEEP_PID} -gt 0 ]; then kill ${PREV_SLEEP_PID} &> /dev/null; fi; eval "${DISABLE_COMMAND}"; sleep ${INTERVAL} && eval "${ENABLE_COMMAND}" & PREV_SLEEP_PID=$!; fi; done // the same in formatted form:
TOUCHPAD_DEV_NAME="ETD2303:00 04F3:3083 Touchpad"; DISABLE_COMMAND="xinput set-prop '$TOUCHPAD_DEV_NAME' 'Synaptics Tap Action' 0 0 0 0 0 0 0"; ENABLE_COMMAND="xinput set-prop '$TOUCHPAD_DEV_NAME' 'Synaptics Tap Action' 0 3 0 0 1 3 2"; INTERVAL=0.2; PREV_SLEEP_PID=0; unbuffer libinput debug-events --show-keycodes | unbuffer -p grep --perl-regexp 'KEY_[0-9A-Z] \([0-9]+\) (pressed|released)' | while IFS='' read -r INPUT || [[ -n "$INPUT" ]]; do if [[ "$INPUT" =~ KEY_[0-9A-Z] ]]; then if [ ${PREV_SLEEP_PID} -gt 0 ]; then kill ${PREV_SLEEP_PID} &> /dev/null; fi; eval "${DISABLE_COMMAND}"; sleep ${INTERVAL} && eval "${ENABLE_COMMAND}" & PREV_SLEEP_PID=$!; fi; done It works like this: the script monitors the output of the libinput debug-events and if it notices that a key is pressed (letters and numbers), turns off the tap (the 'Synaptics Tap Action' parameter) and sets the timer to switch back on.
PS The script may not be very reliable, optimal and all that, so please suggest improvements.
|