wolfgang ziegler


„make stuff and blog about it“

Setting up a Raspberry Pi in Kiosk Mode

October 31, 2016

This is one of these questions that get asked and answered over and over again. If you search for it on the web you will find many different solutions that might or might not work for you … ask me how I know.

The thing is that all these solutions depend on your Linux distribution (and version) and configuration. So I am going to document the steps that worked for me given my specific configuration. Your mileage may vary depending on your system.

Raspian Jessie, September 2016

This image is running the new PIXEL desktop and a Chromium browser by default already. Also I am running with the default user pi, which is relevant for the example below and needs to be considered if you are running a different user.

So these are the steps I took to get a basic clean Kiosk Experience.

Hide the Mouse Cursor

First, we want to get rid of the mouse cursor on the desktop. This is really simple and only requires us to install the unclutter package.

> sudo apt-get install unclutter

To make sure that this actually worked, we can simply restart the desktop using following command:
> sudo service lightdm restart


Disable the Screensaver

The next important step is to prevent the screensaver kicking in and blanking the screen.
The simplest configuration I could come up with was changing the file ~/.config/lxsession/LXDE-pi/autostart like this:

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xset s off
@xset -dpms
@xset s noblank

@/home/pi/run.sh


Note: You will find a lot of contradictory information on the internet about which autostart file(s) you should modify to disable screen blanking.
Most of these answers want you to modify either one of:

/etc/xdg/lxsession/LXDE/autostart.
/etc/xdg/lxsession/LXDE-pi/autostart


From my experience, it’s not necessary to touch any of these. Just leave them as they are.

Auto Start a Browser

The last entry in the above configuration file launches the the script /home/pi/run.sh, which will contain the code for launching Chromium in Kiosk Mode. But we have to create this file first:

> touch /home/pi/run.sh

Then make it executable:

> chmod +x /home/pi/run.sh

Now, let’s edit this file so it looks like this (note: the line breaks are just for formatting reasons).

#!/bin/sh
/usr/bin/chromium-browser http://your-site
--kiosk --noerrdialogs
--disable-session-crashed-bubble
--disable-infobars


Please give this simple recipe a try and let me know if it works for you. If it doesn’t work let me know as well but keep in mind that …

works on the dude's machine