Ubuntu Pastebin

Paste from adrian at Thu, 9 Nov 2017 15:02:24 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# Name that unmistakably identifies mouse. Use `xinput --list` to query.
DEVICE_STRING="A4TECH"

# Default xinput settings; somehow necessary to avoid glitchy behaviour.
xset mouse

# Query device ID
DEVICE_ID=$(xinput --list | grep -Po "${DEVICE_STRING}.+id=\K(\d{1,2})")

# Set profile to "polynomial", arguably the best default. Accelerates any motion (no threshold).
xinput set-prop ${DEVICE_ID} "Device Accel Profile" 2

# Supposedly 1000/DevicePollingRateHz, which would be 1000/1000Hz = 1ms, if my understanding is
# correct (this needs to be set in the kernel!)
xinput set-prop ${DEVICE_ID} "Device Accel Velocity Scaling" 1

# Mouse "speed" effectively
xinput set-prop ${DEVICE_ID} "Device Accel Constant Deceleration" 2.3
Download as text