Skip to content

Setup Raspberry Pi kiosk:Chromium will auto load bing and google tabs

Chromium will auto load bing and google tabs, and xdotool will cycle between the tabs every 30 seconds



The first step is to get Raspbian Pi  OS installed on  Raspberry Pi 3 and 4 to be a digital signage kiosk and using it to show bing and google.
Installing web browser and update system

pi@raspberrypi:~ $ sudo apt-get install -y chromium-browser unclutter xdotool
pi@raspberrypi:~ $ sudo apt-get update  

Setup Auto login for pi user
The Raspberry Pi should auto log in by default, but if not you can check the setting for that by running sudo nano /etc/lightdm/lightdm.conf and looking for:

[SeatDefaults] autologin-user=pi

Create Then we need to create the auto login task which will run the script.

nano /home/pi/.config/autostart/kiosk.desktop  

and added:

[Desktop Entry] Type=Application Name=Kiosk Exec=/home/pi/ X-GNOME-Autostart-enabled=true

Setup the script.

pi@raspberrypi:~ $ nano /home/pi/

#!/bin/bash export DISPLAY=:0 unclutter & sed -i ‘s/”exited_cleanly”:false/”exited_cleanly”:true/’ /home/kiosk/.config/chromium/Default/Preferences sed -i ‘s/”exit_type”:”Crashed”/”exit_type”:”Normal”/’ /home/kiosk/.config/chromium/Default/Preferences # Run Chromium and open tabs /usr/bin/chromium-browser –window-size=1920,1080 –kiosk –window-position=0,0 & while (true) do xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; sleep 30 done

Then make the script executable by running
pi@raspberrypi:~ $ chmod +x

INFO: Chromium will auto load Zendesk and Train departures tabs, and xdotool will cycle between the tabs every 30 seconds. I’m also performing some Chrome clean up in case the system reboots without closing Chrome. This will remove the nag bar.

Managing the system after it’s setup

If you make any changes and want to log out without rebooting, I’ve found that this command works.

This will kill the script and restart the Windows service which will log out and log in the kiosk user.

pi@raspberrypi:~ $ sudo killall && sudo service lightdm restart

How to exit Kiosk mode

The Raspberry Pi PIXEL Desktop allows you to press the Windows key on your keyboard to open their menu.
You can then navigate the menu to
Accessories >

Once in the terminal type
sudo killall chromium-browser

or just press Alt+F4 to close Chromium.

The script will still be running, this script has the xdotool keydowns running (see above). We need to kill that too with sudo killall To remove it all together, refer to the above to remove the /home/pi/.config/autostart/kiosk.desktop file.
Published inRaspberry Pi

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *