I will show you in this tutorial how to start the Midori Browser in full screen mode (kiosk mode) automatically after the Raspberry booted. The graphical shell (desktop) of Rapsian will not be required or started.
A pratical applicaton of this would be, for example, an info monitor on an exhibition. In this project, I want to realise a small contol center for FHEM. Therefore, a PiTFT with capacitive touch screen will be used. This, however, is covered in a later tutorial.
Midori Full Screen Autostart
- Run the following command with the console to update the package list. After that the Midori browser and matchbox will be installed.
sudo apt-get update && sudo apt-get install -y midori matchbox
- Create a new shell script file with the namestartMidori.sh in the home folder and open the Nano text editor. Name and save location can be chosen as you like.
- Add the following code and exit the Nano text editor
x. To save the changes press
#!/bin/sh xset -dpms # disable DPMS (Energy Star) features. xset s off # disable screen saver xset s noblank # don't blank the video device matchbox-window-manager & midori -e Fullscreen -a https://maker-tutorials.com
- Make the script excecutable.
sudo chmod +x startMidori.sh
- You can test the script if you run the following command.
sudo xinit ./startMidori.shYou can exit the Midori browser with the key combination
F1. In case you called the scriped via SSH, you can exit the script via
- In order to automatically excecute the script when the Raspberry starts we need to edit the rc.local file. This script is excecuted when the Raspberry starts.
sudo nano /etc/rc.local
Add the following code before
sudo xinit /home/pi/startMidori.sh &
FRAMEBUFFER=/dev/fb1 xinit /home/pi/startMidori.sh &
&at the end is important that the subsequent lines are excecuted.You can run the script with a time delay if you sourround the command in brackets and preprend /bin/sleep 10 && schreibst. The 10 means a delay of 10 seconds.
(/bin/sleep 10 && xinit /home/pi/startMidori.sh) &
- Unfortunately, the system needs to sign in automatically to be able to run the script. You can set this up easily if you use Raspbian Jessie using
sudo raspi-configand the selecting
Console Autologinunder boot options.
You need to use the following command to the console if you use and older Raspbian version.
sudo nano /etc/inittab
Search the following line
1:2345:respawn:/sbin/getty 115200 tty1
and comment it with
#1:2345:respawn:/sbin/getty 115200 tty1
After this line add the following command.
1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1
This line enables that the user pi logs in without authentication.
- Now you just need to restart the Raspberry pi …
… and the Midori browser should open with the desired webpage in full screen mode.You will exit the Midori Browser using
Optional: Rotate screen
If you want to show the screen in vertical mode or rotate by 180 degrees you can set this up using the following steps.
Open the config.txt file with the Nano editor
sudo nano /boot/config.txt
Add the following test at the beginning of the config.txt file.
- Exit the editing with the shortcut ctrl+x and save the changes with y.
After a restart the screen will be shown rotated as you wanted.
Optional: Hide mouse pointer
- Install the program unclutter.
sudo apt-get install unclutter
unclutter &to the startMidori.sh script.
sudo nano startMidori.sh
#!/bin/sh xset -dpms # disable DPMS (Energy Star) features. xset s off # disable screen saver xset s noblank # don't blank the video device unclutter & matchbox-window-manager & midori -e Fullscreen -a https://maker-tutorials.com
A detailed article about “Raspberry Pi: Run Applications at System Start”