Avatar of Zeke Rich
Zeke Rich
Flag for United States of America asked on

Need to run chromium browser on startup

I just installed linux 2019-09-26-raspbian-buster-lite for Raspberry Pi (headless)

 I need to to run chromium browser on startup. I have installed:

xserver-xorg xinit
chromium-browser
unclutter //to hide the cursor/pointer

I have created a file on my home directory called: ~/.xinitrc
with:
#!/bin/sh
xset -dpms
xset s off
xset s noblank

unclutter &
chromium-browser /path/to/your/file.html --window-size=1920,1080 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI --disk-cache-dir=/dev/null  --password-store=basic

Open in new window


I have added startx & to my rc.local

I cant get chromium to start on boot.
LinuxRaspberry Pi

Avatar of undefined
Last Comment
MURUGESAN N

8/22/2022 - Mon
MURUGESAN N

@Zeke Rich

Comments given after executing following script
$ cat ./29176469.sh
#!/bin/sh
export PS4='$0 $LINENO: '
if [ -z "$DISPLAY" ]
then
	echo -e "----------- PREVIOUS_ERROR1 ----------\nExecute $0 only at GUI mode.\nExecuting at CHUI mode not allowed." >> ~/HandleError.txt
	echo "cat ~/HandleError.txt"
	cat ~/HandleError.txt
else
	xset -dpms
	xset s off
	xset s noblank
	type "unclutter" >/dev/null 2>&1
	if [ 0 -eq $? ]
	then
		unclutter &
		type chromium-browser >/dev/null 2>&1
		if [ 0 -eq $? ]
		then
			chromium-browser /path/to/your/file.html --window-size=1920,1080 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI --disk-cache-dir=/dev/null  --password-store=basic
		else
			echo "----------- PREVIOUS_ERROR2 ----------" >> ~/HandleError.txt
			date >> ~/HandleError.txt
			echo "type chromium-browser" >> ~/HandleError.txt
			type "chromium-browser" >> ~/HandleError.txt 2>&1
			echo "cat ~/HandleError.txt"
			cat ~/HandleError.txt
		fi
	else
		echo "----------- PREVIOUS_ERROR3 ----------" >> ~/HandleError.txt
		date >> ~/HandleError.txt
		echo "type unclutter" >> ~/HandleError.txt
		type unclutter >> ~/HandleError.txt 2>&1
		echo "cat ~/HandleError.txt"
		cat ~/HandleError.txt
	fi
fi

Open in new window


Example output using putty.exe
$ ./29176469.sh
cat ~/HandleError.txt
----------- PREVIOUS_ERROR1 ----------
Execute ./29176469.sh only at GUI mode.
Executing at CHUI mode not allowed.

Open in new window


Output using GUI:
$ ./29176469.sh
cat ~/HandleError.txt
----------- PREVIOUS_ERROR1 ----------
Execute ./29176469.sh only at GUI mode.
Executing at CHUI mode not allowed.
----------- PREVIOUS_ERROR3 ----------
Tue Mar 24 05:41:25 GMT 2020
type unclutter
./29176469.sh: line 32: type: unclutter: not found

Open in new window


I am not having unclutter
Sample testing using touch command at GUI:
$ touch ./unclutter
$ chmod a+x  ./unclutter
$ ./29176469.sh
$ cat ~/HandleError.txt
----------- PREVIOUS_ERROR1 ----------
Execute ./29176469.sh only at GUI mode.
Executing at CHUI mode not allowed.
----------- PREVIOUS_ERROR3 ----------
Tue Mar 24 05:41:25 GMT 2020
type unclutter
./29176469.sh: line 32: type: unclutter: not found
----------- PREVIOUS_ERROR2 ----------
Tue Mar 24 05:42:00 GMT 2020
type chromium-browser
./29176469.sh: line 24: type: chromium-browser: not found
$

Open in new window


Hence try the same at your OS.
ASKER CERTIFIED SOLUTION
Zeke Rich

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
MURUGESAN N

@Zeke Rich

wc
and thank you for sharing the same across the readers at Earth :)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy