Restart browser more robustly. master
authorBenjamin Braatz <benjamin.braatz@graph-it.com>
Wed, 22 Oct 2025 14:21:42 +0000 (16:21 +0200)
committerBenjamin Braatz <benjamin.braatz@graph-it.com>
Wed, 22 Oct 2025 14:34:08 +0000 (16:34 +0200)
kioskpi/home/pi/.bash_profile
kioskpi/home/pi/.config/sway/config
kioskpi/home/pi/restart-browser.sh [new file with mode: 0755]

index fbb64d167f12bfe01844df9f9888ee89cd0d9df1..e75b3ec2c0159cce64c389591e0ea4c93425105f 100644 (file)
@@ -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
index 5f93bf0a072ef9369825f6dbda927bd531b29670..594a5fee8cfaa3f40c1140be9368df92bf6b377c 100644 (file)
@@ -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 (executable)
index 0000000..2080029
--- /dev/null
@@ -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 &