Instead of restarting all of the currently running applications, even if xochitl isn't running, this code should be a little smarter and instead use the remux or oxide APIs to restart the xochitl application if it's running.
if killall -q -0 xochitl; then
killall -SIGCONT xochitl
killall xochitl
i=0
while killall -q -0 xochitl; do
sleep 1;
i=$((i+1))
if [[ "$i" -gt 5 ]]; then
killall -9 xochitl
fi
done
fi
echo 'launch xochitl' > /run/remux.api
https://github.com/Evidlo/remarkable_printer/blob/c30239dc378e4245eb8d83a85bae549dac3d1a5f/main.go#L87-L99
Instead of restarting all of the currently running applications, even if xochitl isn't running, this code should be a little smarter and instead use the remux or oxide APIs to restart the xochitl application if it's running.
Remux launch API: https://github.com/rmkit-dev/rmkit/tree/master/src/remux#launch-api-020 Example:
Oxide Apps API: https://oxide.eeems.codes/documentation/api/02_apps.html Oxide CLI tool for interacting with the API: https://oxide.eeems.codes/documentation/01_usage.html#examples-of-usage Example: