Skip to content

Instantly share code, notes, and snippets.

@gh0st
Last active October 26, 2024 15:39
Show Gist options
  • Save gh0st/402ec0ba098ceb73407500208721e7d2 to your computer and use it in GitHub Desktop.
Save gh0st/402ec0ba098ceb73407500208721e7d2 to your computer and use it in GitHub Desktop.
Write up on how one might set up a pi to launch only a browser, putting it in a "kiosk" mode.

Set up a pi to launch a web browser in kiosk mode

For this project I simply want to have a raspberry pi start and launch a browser in kiosk mode. This pi would act as a status board letting passersby know the status of whatever is being displayed by the pi.

Set up

  1. Download and burn raspian to a micro sd.
  2. Log into the Pi with the default pi user and launch sudo rapsi-config.
  3. Set localization options if necessary.
  4. Change the default password.
  5. Configure the boot to Desktop/CLI and choose Console auto login.
  6. Enable SSH.
  7. Disable "overscan".
  8. Reboot the pi
  9. Update all pre-installed packages
sudo apt-get update
sudo apt-get upgrade
  1. Install xserver and a window manager
sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox
  1. Install a browser.
sudo apt-get install --no-install-recommends chromium-browser
  1. Configure openbox which was installed in step 10. This disables the screensaver and power management.
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
chromium-browser --disable-infobars --kiosk 'http://your-url-here'
  1. Finally, launch startx with
startx -- -nocursor

Courtesy https://die-antwort.eu/techblog/2017-12-setup-raspberry-pi-for-kiosk-mode/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment