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

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