for id in `xinput --list|grep 'Logitech Gaming Mouse G502'|perl -ne 'while (m/id=(\d+)/g){print "$1\n";}'`; do echo "setting device ID $id" #notify-send -t 50000 'Mouse fixed' xinput set-prop $id "Device Accel Velocity Scaling" 100 xinput set-prop $id "Device Accel Constant Deceleration" 200 done