1

Kubuntu 18.10

Each time I plug in my mouse(Razer Deathadder), my touchpad speed is set to a significantly decreased speed. I can temporarily fix it by going to the touchpad settings, where it displays the message,

"Active settings don't match saved settings. You currently see saved settings."

and simply pressing "Apply." How can I fix this, or make a script that reapplies the settings each time I plug in my mouse?

Edit: Using xinput, I discovered the property that is being changed. Initially, accel is set to:

libinput Accel Speed (292):     0.000000

After plugging in the mouse, it is set to:

libinput Accel Speed (292):     -0.780000

So, I can set the accel through terminal using:

xinput set-prop --type=float 18 "libinput Accel Speed" 0.000000

I looked up how to run a script when the mouse is plugged in. I made a udev rule, /etc/udev/rules.d/100-reset-touchpad-accel.rules:

ACTION=="add", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0037", OWNER="tuna", RUN+="/home/tuna/bin/reset_touchpad_accel.sh"

and made a script, /home/tuna/bin/reset_touchpad_accel.sh:

#!/bin/bash

xinput set-prop --type=float 18 "libinput Accel Speed" 0.000000

but it's not working.

Edit 2: I've learned that I can use tail -f /var/log/syslog for debugging. It seems I have to restart udev for changes to take effect sudo service udev restart

Looking at syslog, I saw a permissions issue that I fixed by prepending /usr/bin/sudo -u tuna to my udev rule.

ACTION=="add", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0037", RUN+="/usr/bin/sudo -u tuna /usr/local/bin/reset_touchpad_accel_udev.sh"

But, it still won't run. syslog says

Feb  1 19:11:00 tuna-Latitude-3350 systemd-udevd[21199]: Process '/usr/bin/sudo -u tuna /usr/local/bin/reset_touchpad_accel_udev.sh' failed with exit code 1.

Edit 3: I tried using ENV{SYSTEMD_WANTS}+="/etc/systemd/system/reset-touchpad-accel.service" instead of RUN+= and created a .service file

[Unit]
Type=oneshot

[Service]
ExecStart=/usr/local/bin/reset_touchpad_accel.sh

This isn't working either.

0 Answers0