Note: Raspberry Pi sans desktop avec ouverture de firefox au démarrage
22 juillet 2025 à 19:00
But : avoir un raspberry pi qui affiche, au démarrage, firefox en plein écran et rien de plus. C'est pour une TV d'information / monitoring.
Pour ça, j'utilise la version «no desktop» de «Raspberry Pi OS» avec un auto login.
sudo apt-get install xorg firefox
echo '#!/bin/sh
xrandr -s 1920x1080
exec firefox -height 1080 -width 1920 --window-size 1920,1080 --kiosk file:///home/pi/index.html
' > ~/.xinitrc
# là, ça devient crade mais ça «marche»
echo 'if [[ -z "$DISPLAY" && $(tty) == /dev/tty1 && "$(pgrep firefox)" == "" ]]; then startx -- -nocursor; fi' >> ~/.profile
Pour éteindre ou allumer la TV :
DISPLAY=:0.0 xrandr --listmonitors
DISPLAY=:0.0 xrandr --output HDMI-1 --off
DISPLAY=:0.0 xrandr --output HDMI-1 --auto