diff --git a/fix-motion.sh b/fix-motion.sh new file mode 100755 index 0000000..c26c613 --- /dev/null +++ b/fix-motion.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Start the loop in the background +( + while true; do + python /home/kuba/sdl-enable.py + sleep 1 + done +) & +loop_pid=$! + +# Capture all arguments as the command +cmd=("$@") +# Run the provided command as the hidraw user who can access /dev/hidraw* +#sudo setfacl -R -m u:hidraw:rw $XDG_RUNTIME_DIR +#sudo -E -u hidraw WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ +# XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \ +# QT_QPA_PLATFORM=wayland \ "${cmd[@]}" +"$@" +cmd_status=$? + +# Kill the background loop once the command is done +kill $loop_pid 2>/dev/null