summaryrefslogtreecommitdiff
path: root/dot/local/bin/thinkfix.sh
blob: fec62787963296bfe0168e76aec509c07ff3e298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
sensitivity=128
speed=97

sensitivity=128
speed=50

die() { echo "Error: $*" >&2; exit 1; }

[ "$UID" = 0 ] ||
  exec sudo -- "$0" "$@" ||
  die "you are not root and sudo failed to become root"

#device=/sys/devices/platform/i8042/serio1/serio2
device=$(find /sys/devices/platform/i8042/ -name sensitivity -print -a -quit) &&
  [ "$device" ] || die "could not find i8042 device"
device=${device%/*}

for v in sensitivity speed
do
        echo ${!v} > $device/$v
done