Last active
June 19, 2025 11:25
-
-
Save Bouni/a7d8f6e78ecc5bc4d5c28ed72707d29a to your computer and use it in GitHub Desktop.
A script to setup a minimal wallboard that displays a webpage in a fullscreen chromium with a RaspberryPi
This file contains hidden or 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
#!/bin/sh | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "Run script with sudo!" | |
echo "sudo ./wallboard-setup.sh" | |
exit 1 | |
fi | |
update_system() { | |
# System upgrade and dependency installation | |
apt update && sudo apt upgrade -y | |
echo "✅ System updated!" | |
} | |
install_dependencies() { | |
# Install dependencies | |
apt install -y lightdm openbox chromium-browser unclutter xorg | |
echo "✅ Dependencies installed!" | |
} | |
configure_lightdm() { | |
# Configure lightdm | |
cat << 'EOF' > /etc/lightdm/lightdm.conf | |
[LightDM] | |
[Seat:*] | |
autologin-user=pi | |
autologin-user-timeout=0 | |
user-session=openbox | |
[XDMCPServer] | |
[VNCServer] | |
EOF | |
echo "✅ LightDM configured." | |
} | |
configure_openbox() { | |
# Configure openbox autostart | |
mkdir -p /home/pi/.config/openbox | |
cat << 'EOF' > /home/pi/.config/openbox/autostart | |
#!/bin/bash | |
# Disable screen blanking | |
xset s off | |
xset -dpms | |
xset s noblank | |
# Hide mouse cursor when inactive | |
unclutter -idle 0.5 -root & | |
# Wait for network (optional) | |
until ping -c1 9.9.9.9 >/dev/null 2>&1; do sleep 1; done | |
# Launch Chromium in kiosk mode | |
chromium-browser \ | |
--noerrdialogs \ | |
--disable-infobars \ | |
--kiosk \ | |
--disable-session-crashed-bubble \ | |
--disable-restore-session-state \ | |
--disable-web-security \ | |
--disable-features=VizDisplayCompositor \ | |
--start-fullscreen \ | |
--no-first-run \ | |
--fast \ | |
--fast-start \ | |
--disable-background-timer-throttling \ | |
--disable-backgrounding-occluded-windows \ | |
--disable-renderer-backgrounding \ | |
--app=https://display.fireplan.de/ | |
EOF | |
chmod +x /home/pi/.config/openbox/autostart | |
chown pi:pi /home/pi/.config/openbox/autostart | |
echo "✅ Openbox autostart configured." | |
} | |
configure_services() { | |
# Configure services | |
systemctl set-default graphical.target | |
systemctl disable bluetooth | |
systemctl disable hciuart | |
systemctl disable triggerhappy | |
systemctl disable cups cups-browsed | |
systemctl disable avahi-daemon | |
systemctl disable ModemManager | |
echo "✅ Services enabled / disabled." | |
} | |
configure_overscan() { | |
# Set overscan | |
# In Raspberry Pi OS bookworm the ovberscan settings in /boot/firmware/config.txt no longer work | |
# Therefore we need to add that line in /boot/firmware/cmdline.txt in order to get the screen not to crop the image | |
sed -i '1{/video/!s/$/ video=HDMI-A-1:margin_left=50,margin_right=50,margin_top=30,margin_bottom=30/}' /boot/firmware/cmdline.txt | |
echo "✅ Overscan configured." | |
} | |
configure_vnc() { | |
# Setup VNC to work with UltraVNC Client | |
# Enable VNC using raspi-config non-interactively | |
sudo raspi-config nonint do_vnc 0 | |
# Start and enable the VNC service (just to be sure) | |
sudo systemctl enable vncserver-x11-serviced | |
sudo systemctl start vncserver-x11-serviced | |
echo "✅ VNC has been enabled via raspi-config and the service is running." | |
} | |
update_system | |
install_dependencies | |
configure_lightdm | |
configure_openbox | |
configure_services | |
echo "Do you want to configure overscan? (y/n)" | |
read response < /dev/tty | |
case "$response" in | |
[Yy]|[Yy][Ee][Ss]) | |
configure_overscan | |
;; | |
*) | |
echo "Skipping overscan configuration." | |
;; | |
esac | |
echo "Do you want to configure VNC? (y/n)" | |
read response < /dev/tty | |
case "$response" in | |
[Yy]|[Yy][Ee][Ss]) | |
configure_vnc | |
;; | |
*) | |
echo "Skipping VNC configuration." | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment