Last active
March 6, 2025 13:13
-
-
Save huksley/d5c2cda34094e63d6133fb0104e37eb9 to your computer and use it in GitHub Desktop.
Raspberry PI OS Lite configure kiosk - shows multiple web pages as chrome tabs and rotates between them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get install --no-install-recommends -y xserver-xorg xinit x11-xserver-utils | |
sudo apt-get install -y chromium-browser matchbox-window-manager xautomation unclutter xdotool | |
sudo tee /boot/kiosk.sh <<EOF | |
#!/bin/sh | |
xset -dpms # disable DPMS (Energy Star) features. | |
xset s off # disable screen saver | |
xset s noblank # don't blank the video device | |
setxkbmap -option "terminate:ctrl_alt_bksp" | |
matchbox-window-manager -use_titlebar no & | |
unclutter -idle 0.5 & # hide X mouse cursor unless mouse activated | |
# Disable crash status in chromium | |
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 | |
URLS="https://google.com https://github.com/trending" | |
chromium-browser \$URLS \\ | |
--enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter \\ | |
--window-size=1920,1080 \\ | |
--window-position=0,0 \\ | |
--start-fullscreen \\ | |
--kiosk \\ | |
--incognito \\ | |
--noerrdialogs \\ | |
--disable-translate \\ | |
--no-first-run \\ | |
--fast \\ | |
--fast-start \\ | |
--disable-infobars \\ | |
--disable-features=TranslateUI \\ | |
--disk-cache-dir=/dev/null \\ | |
--overscroll-history-navigation=0 \\ | |
--check-for-update-interval=31536000 \\ | |
--disable-pinch & | |
# Start the kiosk loop. This keystroke changes the Chromium tab | |
# To have just anti-idle, use this line instead: | |
# xdotool keydown ctrl; xdotool keyup ctrl; | |
# Otherwise, the ctrl+Tab is designed to switch tabs in Chrome | |
while (true) | |
do | |
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; | |
sleep 15 | |
done | |
EOF | |
tee /home/pi/.xinitrc<<EOF | |
sh /boot/kiosk.sh | |
EOF | |
tee /home/pi/.bashrc<<EOF | |
if [ -z "\$SSH_CLIENT" ] || [ -z "\$SSH_TTY" ]; then | |
startx | |
fi | |
EOF | |
Connect sdcard and edit kiosk.sh on any OS in boot partition.
Enter URL="" any list of addresses to open, including
- Pages
- https://docs.google.com/presentation/d/1234567890/present?usp=sharing Google Drive publication
- Images, PDFs
Connect a button for shutdown (or other scripts)
https://github.com/shivasiddharth/pi-shut/
Running offline with local files
- Disable wait for network at boot
- Place files to /boot
Change URLS="file:///1.html"
Enable accelerated video (Raspberry PI 4)
Watchdog to automatically restart Raspberry PI if it became unresponsive https://diode.io/raspberry%20pi/running-forever-with-the-raspberry-pi-hardware-watchdog-20202/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Force HDMI & 1080p
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16
disable_overscan=1
Rotate screen
echo "display_rotate=3" | sudo tee -a /boot/config.txt
Splash + hide console msgs
Change
console=tty3
and addquiet splash plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0
in /boot/cmdline.txt (single line)
Add splash for plymouth
sudo apt install plymouth plymouth-themes pix-plym-splash
wget https://example.com/my/splash.png
sudo mv splash.png /usr/share/plymouth/themes/pix/splash.png
Move console to tty3 to disable output messages of startx
Change files in
/etc/systemd/system
- see[email protected]/, getty.target.wants/
basically rename everything to tty3 and change content to point to tty3 instead of tty1See more here: https://raspberrypi.stackexchange.com/questions/36657/hide-complete-boot-message-from-rpi-booting
Remove rainbow screen at boot
Add
disable_splash=1
to /boot/config.txtControl TV with CEC
https://www.linuxuprising.com/2019/07/raspberry-pi-power-on-off-tv-connected.html
https://ubuntu-mate.community/t/controlling-raspberry-pi-with-tv-remote-using-hdmi-cec/4250