Starting Chromium to go to a specific site
-
I have chromium running on Retropie, and I would like to send chromium to a specific site. The plan is to make several entries in gamelist.xml and have a script per site.
When starting Chromium you can pass a URL and Chromium would launch that site. For example in bash if you run:
chromium https://www.spotify.com
Chromium will launch and start with the Spotify home page.
I was reading the docs and code and it looks like runcommand.sh is used to start Chromium. The runcommand.sh comments call out:
runcommand.sh VIDEO_MODE COMMAND SAVE_NAME
Where in this case the command is 'chromium'
#!/bin/bash "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "chromium" ""
I edited it to be:
#!/bin/bash "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "chromium http://www.spotify.com" ""
When it runs I get an error:
No config found for system chromium http://www.spotify.com
Does anyone know what I'm doing wrong?
-
@prioret In the launch script:
Chromium - Open Source Web Browser.sh
:"/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "chromium" ""
...note the final, empty pair of quotes. This is the "
%ROM%
" parameter, that will be passed by the front-end EmulationStation to the launch utilityruncommand
and ultimately to the application. This is where we could put the URL. Try making a copy of this script and put a URL between the final quotes, ex:chromium_test.sh
:"/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "chromium" "https://retropie.org.uk/forum"
In the runcommand emulator config file:
/opt/retropie/configs/ports/chromium/emulators.cfg
:chromium="XINIT: /opt/retropie/supplementary/chromium/chromium.sh" default="chromium"
...note that it's not using the
%ROM%
parameter at all. Edit thechromium=
line to add%ROM%
at the end so it reads:chromium="XINIT: /opt/retropie/supplementary/chromium/chromium.sh %ROM%"
Finally, in the file
/opt/retropie/supplementary/chromium/chromium.sh
:#!/bin/bash xset -dpms s off s noblank matchbox-window-manager -use_titlebar no & /usr/bin/chromium-browser
...edit the
/usr/bin/chromium-browser
line to add"$@"
at the end so it reads:/usr/bin/chromium-browser "$@"
This
$@
var stands in for "all arguments passed to this script" which, because ofemulators.cfg
is%ROM%
which, because ofchromium_test.sh
is the URL (you could also pass any other command-line options here, too.)Restart EmulationStation and try launching the chromium_test item. If it worked, it should open the RetroPie forum homepage.
-
@sleve_mcdichael said in Starting Chromium to go to a specific site:
It worked perfectly!
Thanks! -
@prioret hi, a bit off topic but how do you install chromium? Not finding many recent answers on Google.
-
@Matt_B50 chromium is available in the external RetroPie-Extra project:
-
@sleve_mcdichael Thank you!
-
This is great! I have got it running in kiosk mode by adding "--kiosk" before the URL (as a separate parameter)
One question - any way to hid the mouse cursor when this starts? Tried setting use_cursor to no on matchbox-window-manager but that doesn't stop it (in /opt/retropie/supplementary/chromium/chromium.sh)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.