Skip to content

Instantly share code, notes, and snippets.

@evokateur
Last active July 7, 2025 07:24
Show Gist options
  • Save evokateur/40b6d606ba2f5d7df85b9f4f944ff8ba to your computer and use it in GitHub Desktop.
Save evokateur/40b6d606ba2f5d7df85b9f4f944ff8ba to your computer and use it in GitHub Desktop.

Get Natural

This is how I get natural mouse scrolling in a MATE desktop environment (Parrot OS). It should work with any X11 window manager.

So far, I haven't found a way to permanently configure it. It basically finds any device that seems to have a natural scrolling property and turns it on.

I currently run the script from .bashrc, and whenever things start going the wrong direction I open a terminal.

#!/bin/bash
device_ids=$(xinput -list | grep -i 'pointer' | grep -o id=[0-9]. | grep -o [0-9].)
for device_id in ${device_ids[@]}
do
prop_id=`xinput list-props ${device_id} | grep -i "Natural Scrolling Enabled" | grep -Po '(?<=\().*(?=\))' | head -1`
if [ "${prop_id}" ]; then$
xinput set-prop ${device_id} ${prop_id} 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment