Skip to content

Instantly share code, notes, and snippets.

@ecoologic
Created March 31, 2025 02:04
Show Gist options
  • Save ecoologic/c351307df5d57202dabbff6b9d8bc186 to your computer and use it in GitHub Desktop.
Save ecoologic/c351307df5d57202dabbff6b9d8bc186 to your computer and use it in GitHub Desktop.
#!/bin/bash
# From https://forums.linuxmint.com/viewtopic.php?t=261998
# Enable "natural scrolling" (reverse mouse wheel) in Linux
# to debug
# set -x
echo "reverse-mouse-scroll"
mouseid=$(xinput --list | grep "DaKai 2.4G RX Mouse" | sed -E 's/.*id=([0-9]+).*/\1/' | head -n1)
echo "DaKai" $mouseid
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1
mouseid=$(xinput --list | grep "Logitech Wireless Mouse MX Master 3" | sed -E 's/.*id=([0-9]+).*/\1/' | head -n1)
echo "Logi" $mouseid
xinput --set-prop $mouseid 'libinput Natural Scrolling Enabled' 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment