Chromium kiosk mode on raspberry pi
From the terminal (or SSH):
mkdir /home/pi/.config/autostart
Create the config file and enter the following:
nano /home/pi/.config/autostart/kiosk.desktop
[Desktop Entry]
Type=Application
Name=Kiosk
Exec=/home/pi/kiosk.sh
X-GNOME-Autostart-enabled=true
Create the script the Pi will run at start-up:
nano /home/pi/kiosk.sh
#!/bin/bash
# Run this script in display 0 - the monitor
export DISPLAY=:0
# Hide the mouse from the display
unclutter &
# If Chrome crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
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
# Run Chromium and open a tab
chromium-browser --kiosk https://mysite.domain.com
Make the script executable by running:
chmod +x /home/pi/kiosk.sh
Don't forget to disable your screensaver!