ultimate_kiosk.sh
Ultimate Kiosk Script with RaspberryPi OS (Buster) and Xdotool:
First install xdotool: sudo apt-get install xdotool
and then Chromium sudo apt install chromium-browser -y
.
Second step ist to save this script on your Pi-Desktop as ultimate_kiosk.sh:
#!/bin/bash
xset s noblank
xset s off
xset -dpms
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
/usr/bin/chromium-browser --noerrdialogs --kiosk --enable-features=OverlayScrollbar --window-position=0,0 "http://your website" &
/usr/bin/chromium-browser --noerrdialogs --kiosk --enable-features=OverlayScrollbar --window-position=0,0 "http://your website2" &
while (true)
do
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; xdotool key ctrl+r ;
sleep 600
done
What the script does: it starts a chromium-session without any window elements only with your given web-adress (or adresses) and reload the websites after a interval (now 600 seconds, 10 Minutes), change this as required. Xdotool opens the websites in different Browser-tabs and browse them.
Save the Script and turn Autostart on with (chmod 755 your Script):
sudo pico /etc/xdg/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@lxterminal -e /home/pi/Desktop/ultimate_kiosk.sh
P.S.: Don’t waste Time with https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/.
Optional:
--force-device-scale-factor=2.0