Skip to content

Instantly share code, notes, and snippets.

@MrEliptik
Created February 2, 2019 09:53
Show Gist options
  • Save MrEliptik/e64ea27af61c0a7440a84d6aa14b7eaa to your computer and use it in GitHub Desktop.
Save MrEliptik/e64ea27af61c0a7440a84d6aa14b7eaa to your computer and use it in GitHub Desktop.
Bash script to configure scrolling with xinput
#!/bin/bash
# Enable "natural scrolling" (reverse mouse wheel) in Linux
# to debug
# set -x
# get the mouseid by filtering output of xinput --list
# matches id of first device with word "mouse"
mouseid=$(xinput --list | sed -E '/mouse/I!d;s/.*?mouse.*?id=([0-9]+).*/\1/i;q')
touchpadid=$(xinput list --id-only 'SYNA2393:00 06CB:7A13 Touchpad')
echo $mouseid
echo $touchpadid
# set natural scrolling property to given mouseid
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 0
xinput --set-prop $touchpadid 'libinput Natural Scrolling Enabled' 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment