Skip to content

Instantly share code, notes, and snippets.

@jazztickets
Created July 4, 2017 19:43
Show Gist options
  • Save jazztickets/0dfa1f2a228b5914493ce6eaf5f5a6d3 to your computer and use it in GitHub Desktop.
Save jazztickets/0dfa1f2a228b5914493ce6eaf5f5a6d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# check for xinput
command -v xinput >/dev/null 2>&1 || { echo "install xinput" >&2; exit 1; }
# list pointers
list=`xinput list | grep "slave *pointer" | grep -vi "virtual core" | grep -vi "keyboard"`
count=`echo "$list" | wc -l`
echo "$list"
# get id
if [ "$count" -eq 1 ]; then
id=`echo "$list" | grep "id=[0-9]\+" -o | sed 's/id=//' `
echo "Using id=$id"
else
echo "Enter a valid pointer id"
read id
fi
echo
# set sensitivity
while :; do
curval=$(xinput list-props $id | grep "libinput Accel Speed" | cut -f 2 -d ':' | tr -d '[[:space:]]')
echo "Current value is ${curval}. Enter a new sensitivity value (ctrl+c to quit):"
read value
xinput set-prop $id 'libinput Accel Speed' $value
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment