1

Edit: RPi 3, fully updated.

I have a raspberry pi build where RPi is supposed to run a bash script on boot. The script shows specific videos, then opens chromium and runs specific webpage in fullscreen.

The script itself does what it is supposed to do when I run it from command line. But if I put it in autostart, it doesn't resize chromium (F9 needs to be pressed for the application to run in full screen, it's a custom app).

I've tried adding it to .bashrc. Tried LXDE-pi/autostart. Tried crontab (does nothing at all). Even tried Supervisord. All those tools run the script, but don't resize the page.

Am I doing something wrong? Please help. Been stuck at this for ages.

Here's the script:

#!/bin/bash
sleep 60
while :
do
    omxplayer -b /home/video/1.mp4 &>/dev/null
    omxplayer -b /home/video/2.mp4 &>/dev/null
    omxplayer -b /home/video/3.mp4 &>/dev/null
    omxplayer -b /home/video/4.mp4 &>/dev/null
    omxplayer -b /home/video/5.mp4 &>/dev/null
    omxplayer -b /home/video/6.mp4 &>/dev/null
    omxplayer -b /home/video/7.mp4 &>/dev/null
    omxplayer -b /home/video/8.mp4 &>/dev/null
    omxplayer -b /home/video/9.mp4 &>/dev/null
    omxplayer -b /home/video/10.mp4 &>/dev/null
    omxplayer -b /home/video/11.mp4 &>/dev/null
    omxplayer -b /home/video/12.mp4 &>/dev/null
    lxterminal -e  ./chromium.sh
    lxterminal -e sleep 20 && xdotool search --title CNR windowactivate --sync key F9
    sleep 60 &>/dev/null
    pkill chromium &>/dev/null
done

chromium.sh code:

#!/bin/bash

chromium-browser --noerrdialogs --disable-session-crashed-bubble
Kelsier
  • 11
  • 3

1 Answers1

0

Use the --kiosk option of chromium-browser in the autostart script as below:

#!/bin/bash

chromium-browser --noerrdialogs --disable-session-crashed-bubble --kiosk
Aurora0001
  • 6,308
  • 3
  • 23
  • 38
user73636
  • 117
  • 3
  • 12
  • Forgot to mention, kiosk does not do what I need. The app is custom and need F9 to make map fullscreen. Otherwise it has a side panel. Even in kiosk mode – Kelsier Oct 30 '17 at 14:49
  • @kelsier: try xdotool key F9 – user73636 Oct 30 '17 at 15:23
  • " lxterminal -e sleep 20 && xdotool search --title CNR windowactivate --sync key F9"

    This line does that exactly. Since I need to run it after chromium starts and chromium run isn't a full command, I need to run it in a seperate terminal. That works when I run the script from terminal by hand. But when I put it to autostart, it doesn't work.

    – Kelsier Oct 31 '17 at 06:02
  • How can I bump this thread? – Kelsier Nov 06 '17 at 07:11