From 467b147dd04330670104b8822f31f77416852642 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 18 Jul 2026 17:14:13 +0200 Subject: [PATCH] Add fix-motion script --- fix-motion.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 fix-motion.sh 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