You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
552 B
Bash
24 lines
552 B
Bash
#!/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
|