Photo by @lukechesser on Unsplash

Make Raspberry Pi display an URL on boot

27 April, 2021

There's often a couple of Raspberry Pi laying around, or an old laptop. Let's make it into a status screen, that'll show any URL on boot.

Reinstall Raspberry Pi OS or Debian

In case of an old computer, install debian. In case of Raspberry Pi, install Raspberry Pi OS

"Do I have to, it already got an OS?" No you don't, but there's a risk that you'll regreat that you didn't – especially if your Pi or laptop is old.

Add Firefox

# Firefox
apt-get install iceweasel xdotool -y

Write startup script

Add this script as /home/pi/startup.sh.

#!/bin/sh

# open build screen url in firefox
iceweasel --kiosk http://url.to.build.screen.com

# refresh every 10 min
while true; do
sleep 600;
xdotool key ctrl+r;
done;

Add script to startup

chmod 755 /home/pi/startup.sh
mkdir -p .config/lxsession/LXDE-pi
vim .config/lxsession/LXDE-pi

This is the boot file, saying what the Po should do on startup. If you have a public display, where the Pi should be locked down, simply write the following and save.

@./startup.sh

If you want to have the desktop available, and easy access to config things, write the following instead.

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s off
@xset -dpms   # Turns off screensaver
@xset s noblank
point-rpi
@./startup.sh

This boots up the desktop too.

Done!

That's it! You can test it by rebooting :)

  • If you want to get out of a locked down kiosk-mode, press ctrl + alt + F2 to get a login terminal.

  • If your screensaver is not turned off, see

  • If you need to login or send key presses to the browser, e.g. typing in a password or similar, check out /build-screen-bootup/ post, using xdotools.