Start by installing chromium and unclutter which will hide the cursor on the screen:
sudo apt install -y -no-install-recommends chromium-browser unclutter
The autostart
file is part of the LXDE (Lightweight X11 Desktop Environment) and LXQt desktop environments, commonly used in lightweight distributions of Linux, including Raspberry Pi OS. This file is used to automatically start applications and run scripts when the LXDE desktop session begins.
Open up the autostart config in your favorite editor:
sudo vi /etc/xdg/lxsession/LXDE-pi/autostart
Then paste in the follow contents:
# xset is a utility for setting user preferences for X (the window system)
# disables the screen saver feature that blanks the screen:
@xset s noblank
# turns off the screen saver, ensuring the screen doesn't get blanked after a period of inactivity:
@xset s off
# disables DPMS (Display Power Management Signaling), preventing the monitor from entering standby,
# suspend, or off modes automatically:
@xset -dpms
# use unclutter to hide the cursor:
@unclutter -idle 0
# open chromium in kiosk mode without dialogs/navbars etc:
@chromium-browser --noerrdialogs --disable-infobars --kiosk <YOUR_URL_HERE>
Change <YOUR_URL_HERE>
to your URL, say https://google.com
.
LightDM
is a lightweight display manager for the X window system. A display manager is a graphical login manager which starts a session, manages user authentication, and then loads the desktop environment.
Now, edit the lightdm config:
sudo vi /etc/lightdm/lightdm.conf
...and find the xserver-command
line under the [Seat:*]
section and change it to:
xserver-command=X -s 0 dpms
Finally, reboot to see your new web page loaded in kiosk mode
sudo reboot