From 07fc475ca17f106bfa2b7d1079d274d9d33be973 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 26 Jan 2021 10:28:18 -0500 Subject: [PATCH] More fun with xinput --- local/bin/xinput-preferences | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/local/bin/xinput-preferences b/local/bin/xinput-preferences index 3b19b87..ac9da1a 100755 --- a/local/bin/xinput-preferences +++ b/local/bin/xinput-preferences @@ -4,16 +4,27 @@ set -o pipefail main() { _setup_elan_touchpad + _setup_trackman_marble } _setup_elan_touchpad() { local etp='Elan Touchpad' - xinput list | if ! grep -q "${etp}"; then + if ! xinput list-props "${etp}" &>/dev/null; then return fi xinput set-prop "${etp}" 'libinput Tapping Enabled' 1 xinput set-prop "${etp}" 'libinput Natural Scrolling Enabled' 1 } +_setup_trackman_marble() { + local tmm='Logitech USB Trackball' + + if ! xinput list-props "${tmm}" &>/dev/null; then + return + fi + xinput set-prop "${tmm}" 'libinput Button Scrolling Button' 8 + xinput set-prop "${tmm}" 'libinput Scroll Method Enabled' 0 0 1 +} + main "${@}"