From: Benjamin Braatz Date: Wed, 22 Oct 2025 14:21:42 +0000 (+0200) Subject: Restart browser more robustly. X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=56d6b974890b983ac9c19ce0a28e9b1c3879a61a;p=graphit%2Fcontrolpi-image.git Restart browser more robustly. --- diff --git a/kioskpi/home/pi/.bash_profile b/kioskpi/home/pi/.bash_profile index fbb64d1..e75b3ec 100644 --- a/kioskpi/home/pi/.bash_profile +++ b/kioskpi/home/pi/.bash_profile @@ -9,5 +9,5 @@ if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ] then export WLR_LIBINPUT_NO_DEVICES=1 export XKB_DEFAULT_OPTIONS="numpad:mac" - exec sway + exec sway &> /tmp/sway.log fi diff --git a/kioskpi/home/pi/.config/sway/config b/kioskpi/home/pi/.config/sway/config index 5f93bf0..594a5fe 100644 --- a/kioskpi/home/pi/.config/sway/config +++ b/kioskpi/home/pi/.config/sway/config @@ -11,4 +11,4 @@ default_border none seat seat0 hide_cursor 3000 # Startup firefox -exec firefox --kiosk /home/pi/index.html +exec /home/pi/restart-browser.sh diff --git a/kioskpi/home/pi/restart-browser.sh b/kioskpi/home/pi/restart-browser.sh new file mode 100755 index 0000000..2080029 --- /dev/null +++ b/kioskpi/home/pi/restart-browser.sh @@ -0,0 +1,5 @@ +#!/bin/sh +killall -q -0 firefox && killall firefox +killall -q -0 firefox && killall -9 firefox +rm -rf ~/.mozilla/* ~/.cache/mozilla/ +WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/1000 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus nohup firefox --kiosk /home/pi/index.html &> /tmp/firefox.log &