theniceboy/i3/inverse-scroll.sh
2019-07-24 23:35:37 +08:00

11 lines
398 B
Bash
Executable file

#!/bin/bash
# Get id of touchpad and the id of the field corresponding to
# natural scrolling
id=`xinput list | grep "Touchpad" | cut -d'=' -f2 | cut -d'[' -f1`
natural_scrolling_id=`xinput list-props $id | \
grep "Natural Scrolling Enabled (" \
| cut -d'(' -f2 | cut -d')' -f1`
# Set the property to true
xinput --set-prop $id $natural_scrolling_id 1