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.

Revisions

  1. cmbuckley revised this gist Jul 30, 2025. No changes.
  2. cmbuckley revised this gist Jul 30, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mac-mouse-scroll.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/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)
    defaults write -g com.apple.swipescrolldirection -bool $(ioreg -p IOUSB -w0 | grep -q Mouse && echo false || echo true)
  3. cmbuckley revised this gist Jul 30, 2025. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions mac-mouse-scroll.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #!/bin/bash

    # flip scroll direction based on whether a mouse is plugged in
    defaults write -g com.apple.swipescrolldirection \
    -bool $(ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*' | grep -q Mouse && echo false || echo true)
    defaults write -g com.apple.swipescrolldirection -bool $(ioreg -p IOUSB -w0 grep -q Mouse && echo false || echo true)
  4. cmbuckley revised this gist Jul 30, 2025. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mac-mouse-scroll.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/bash

    # flip scroll direction based on whether a mouse is plugged in
    defaults write -g com.apple.swipescrolldirection -bool $(ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*' | grep -q Mouse && echo false || echo true)
    defaults write -g com.apple.swipescrolldirection \
    -bool $(ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*' | grep -q Mouse && echo false || echo true)
  5. cmbuckley created this gist Jul 30, 2025.
    4 changes: 4 additions & 0 deletions mac-mouse-scroll.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    #!/bin/bash

    # flip scroll direction based on whether a mouse is plugged in
    defaults write -g com.apple.swipescrolldirection -bool $(ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*' | grep -q Mouse && echo false || echo true)