Code: Select all
sudo aptitude install openbox obconf obmenu Code: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openboxCode: Select all
nano ~/.config/openbox/autostartCode: Select all
# Autostart script
#will sleep to make sure everything else loads
sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.htmlbredman wrote:To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk http://www.google.com
to launch Chromium in full-screen pointed to http://www.google.com
I have done this but it does not recognise chromium-browser.... I changed it to simply chromium instead but I get the error (chromium:2100): Gtk-WARNING **: cannot open display:To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com
I hope somebody can solve that, I get the same thing when I try to open a VNC server on my Pi, so do not know the answer at this point.coolblue2000 wrote:I have tried export DISPLAY=:1 and export DISPLAY=:0
Both give me the error "Cannot open display:1" or "Cannot open display:0"
Super-Nathan wrote:Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.
and then make a openbox config file withCode: Select all
sudo aptitude install openbox obconf obmenu
Then edit the autostart to openthe browser at bootCode: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox
remove all the code and past this in:Code: Select all
nano ~/.config/openbox/autostart
that will make it run with fewer options auto resetting after 2 minutes inactivityCode: Select all
# Autostart script #will sleep to make sure everything else loads sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html
I've tried exactly this using the latest Raspbian from noobs, nothing happened. Do I need to set it to boot into command line because mine boots into the GUI automaticallySuper-Nathan wrote:Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.
and then make a openbox config file withCode: Select all
sudo aptitude install openbox obconf obmenu
Then edit the autostart to openthe browser at bootCode: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox
remove all the code and past this in:Code: Select all
nano ~/.config/openbox/autostart
that will make it run with fewer options auto resetting after 2 minutes inactivityCode: Select all
# Autostart script #will sleep to make sure everything else loads sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html
Code: Select all
sudo aptitude install xautomationCode: Select all
touch start_browser.shCode: Select all
# running the browser on the main desktop
sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 &
# waits a few seconds, we wait that the browser has started successfully
sleep 15s;
# xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop
xte "key F11" -x:0Code: Select all
sudo chmod 755 start_browser.shCode: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostartCode: Select all
@/home/pi/start_browser.shCode: Select all
sudo raspi-configCode: Select all
sudo aptitude install xautomationCode: Select all
touch start_browser.shCode: Select all
# running the browser on the main desktop
sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 &
# waits a few seconds, we wait that the browser has started successfully
sleep 15s;
# xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop
xte "key F11" -x:0Code: Select all
sudo chmod 755 start_browser.shCode: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostartCode: Select all
@/home/pi/start_browser.shCode: Select all
sudo raspi-configI tried this and after the reboot nothing happened... I am a noob so maybe there is something I did wrong?fvlgnn wrote: ↑Wed Jul 20, 2016 12:20 pmI solved using autostart of LXDE-pi and a sh file and epiphany browser.
I had to install xautomation for simulate an user input
In the home of pi I've created a sh fileCode: Select all
sudo aptitude install xautomation
I've inserted the following code in the fileCode: Select all
touch start_browser.sh
I added the executable permission on the sh file with chmod commandCode: Select all
# running the browser on the main desktop sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 & # waits a few seconds, we wait that the browser has started successfully sleep 15s; # xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop xte "key F11" -x:0
I've modified the autostart files of LXDE-pi sessionCode: Select all
sudo chmod 755 start_browser.sh
by adding the following command to run my sh fileCode: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Now our browser should be start in full screen mode at each bootCode: Select all
@/home/pi/start_browser.sh
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Select: 3 Enable Boot to Desktop/ScratchCode: Select all
sudo raspi-config
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy