mouse-acceleration 644 B

1234567891011121314151617
  1. #!/bin/sh
  2. # Script to Disable Mouse Acceleration (for dwm)
  3. # dmenu prompt to select the right device (using xorg-xinput)
  4. deviceID=$(xinput | grep -B1000 "Virtual core keyboard" | preconv | cut -d' ' -f5- |\
  5. sed '$ d; /^$/d;' | grep -v "master pointer" | rev | cut -d' ' -f5- | rev |\
  6. sed 's/\[slave//g;' | tr '\t' ' ' | dmenu -i -l 30 | awk '{print $NF}' | sed 's/id=//g')
  7. [ -z "$deviceID" ] && exit 1
  8. # disable the mouse acceleration (using xorg-xinput)
  9. xinput --set-prop "$deviceID" 'libinput Accel Speed' 0
  10. xinput --set-prop "$deviceID" 'libinput Accel Profile Enabled' 0, 1
  11. # set the mouse speed (using xorg-xset)
  12. xset mouse 1 0 &