Add script for auto-retry on device loss

This commit is contained in:
Lauri Räsänen 2024-06-23 12:19:35 +03:00
parent c29a3b5e91
commit fd7421254e
3 changed files with 21 additions and 9 deletions

View file

@ -12,12 +12,12 @@ Largely based on [systemofapwne/leetmouse](https://github.com/systemofapwne/leet
- `cargo install --path .` - `cargo install --path .`
- `evdev-accel --help` - `evdev-accel --help`
See [examples/evdev-accel.desktop](examples/evdev-accel.desktop) for XDG desktop entry. See [examples/evdev-accel-service.sh](examples/evdev-accel-service.sh) for auto-retry on device loss.
## TODO ## TODO
- XDG desktop entry -- I couldn't get one to work on login, only with manual exec after login
- Add default config if no cfg file - Add default config if no cfg file
- Retry on device loss
- Min/Max accel settings - Min/Max accel settings
- Accel offset - Accel offset
- Different accel curves - Different accel curves

19
examples/evdev-accel-service.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
#
# Script for running evdev-accel again on device loss
#
DEVICE="Your device name here"
while true; do
evdev-accel -d "$DEVICE"
ex="$?"
if [ $ex = 0 ]; then
echo "evdev-accel exited with code 0, quitting"
break
fi
echo "evdev-accel exited with code $ex, retrying in 1 second"
sleep 1
done

View file

@ -1,7 +0,0 @@
[Desktop Entry]
Type=Application
Exec=evdev-accel -d "Your Device Here"
Name=evdev-accel
Comment=Start evdev-accel
GenericName=Mouse Acceleration
Terminal=false