Skip to content

Instantly share code, notes, and snippets.

@cmbuckley
Last active July 30, 2025 08:15
Show Gist options
  • Save cmbuckley/c0c39559c2e052c8b218007d0f6aa2a7 to your computer and use it in GitHub Desktop.
Save cmbuckley/c0c39559c2e052c8b218007d0f6aa2a7 to your computer and use it in GitHub Desktop.
Natural scrolling on a trackpad, but classic scrolling when a mouse is plugged in
#!/bin/bash
# flip scroll direction based on whether a mouse is plugged in
defaults write -g com.apple.swipescrolldirection -bool $(ioreg -p IOUSB -w0 | grep -q Mouse && echo false || echo true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment