-
- #!/usr/bin/env bash
-
- id=8
- propSens=154
- propAccel=280
-
- screenWidth=1920
- screenHeight=1080
-
- if [ "$1" == "-h" ]; then
- echo "HOW TO SET UP SCRIPT:"
- echo "Before the script will work you need to provide it with some information."
- echo "Maybe one day I'll work on automating it, but for now you have to do it manually:"
- echo ""
- echo "1) In a terminal run \"xinput\""
- echo " Look for your mouse \"id\". If you aren't sure which one it is,"
- echo " or if you see duplicates then just pick one. If it doesn't work"
- echo " at the end then return to this step and try a different value."
- echo ""
- echo "2) Take the \"id\" value from above and use it with the command:"
- echo " xinput list-props ID"
- echo ""
- echo "3) Look for the value \"Coordinate Transformation Matrix\","
- echo " and directly to the right of it is a number in parenthesis."
- echo " This number will be called \"propSens\""
- echo ""
- echo "4) Look for the value \"Device Accel Profile\","
- echo " The number in parenthesis will be called \"PropAccel\""
- echo ""
- echo "5) Open this script up in a text editor and change the values for"
- echo " id, propSens, and propAccel that you found above."
- echo " Also adjust the screenWidth and screenHeight variables to your resolution"
- echo ""
- echo "6) Run the script and tell it to use any sensitivity you want. For example:"
- echo " ./this_script SENSITIVITY"
- echo " If it doesn't work then go back to step #1 and try a different id."
- fi
-
- sens=$1
-
- xoffset=`python -c "print(${screenWidth}*0.5-${screenWidth}*0.5*${sens}+1)"`
- yoffset=`python -c "print(${screenHeight}*0.5-${screenHeight}*0.5*${sens}+1)"`
-
- xset m 0 0; xinput set-prop ${id} ${propAccel} -1; xinput set-prop ${id} ${propSens} ${sens}, 0, ${xoffset}, 0, ${sens}, ${yoffset}, 0, 0, 1
-