6

I've tried trawling through the RPI community threads for suggestions to start Chromium through a shell script.

I originally tried to do this with Crontab however because the cron user doesn't have the necessary environment variables I wanted to try with LXDE.

This thread is inaccurate for RPi4 as there is no lxsession in my .config folder in PI home

https://www.raspberrypi.org/forums/viewtopic.php?t=219952

Here is an ls-la of .config:

drwx------ 17 pi pi 4096 Aug 19 17:43 chromium
drwx------  2 pi pi 4096 Jun 20 18:45 dconf
drwx------  2 pi pi 4096 Aug 16 15:02 gtk-2.0
drwx------  2 pi pi 4096 Aug 16 15:23 leafpad
drwx------  2 pi pi 4096 Aug 16 15:36 libfm
drwx------  3 pi pi 4096 Jun 20 18:20 lxpanel
-rw-r--r--  1 pi pi  164 Aug 16 14:58 lxtask.conf
drwx------  2 pi pi 4096 Jun 20 18:24 lxterminal
drwx------  3 pi pi 4096 Aug 16 15:02 pcmanfm
-rw-------  1 pi pi  633 Jun 20 18:20 user-dirs.dirs
-rw-r--r--  1 pi pi    5 Jun 20 18:20 user-dirs.locale

Debian version is:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster

So how can I get Chromium to autostart on boot?

tomaytotomato
  • 183
  • 1
  • 1
  • 5

2 Answers2

12

Jonathan's answer was almost how I managed to do it on my Respberry Pi 4 (running Raspbian Buster), but with some small alterations (I would've commented under his answer if I could, but not enough rep).

In a terminal window:

  1. sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
  2. Then append the following to the end of the file and save:
    /usr/bin/chromium-browser --kiosk --ignore-certificate-errors --disable-restore-session-state https://www.google.com
  3. Reboot

Notes: the changes opposed to Jonathan's answer are: "chromium-browser" instead of just "chromium", and no apostrophes around the url. The "--kiosk" command (and the other commands) are optional ofcourse.

Bram
  • 121
  • 1
  • 3
0

Enter:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart && /usr/bin/chromium --kiosk --ignore-certificate-errors --disable-restore-session-state "https://www.google.com"

Close the file, and you're done!

EDIT: Reboot after you're done!

John U
  • 199
  • 1
  • 13
zurgeg
  • 115
  • 1
  • 8