RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Starting Chromium to go to a specific site

    Scheduled Pinned Locked Moved Help and Support
    runcommand
    7 Posts 3 Posters 781 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      prioret
      last edited by

      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?

      S 1 Reply Last reply Reply Quote 0
      • S
        sleve_mcdichael @prioret
        last edited by sleve_mcdichael

        @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 utility runcommand 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 the chromium= 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 of emulators.cfg is %ROM% which, because of chromium_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.

        P 1 Reply Last reply Reply Quote 1
        • P
          prioret @sleve_mcdichael
          last edited by prioret

          @sleve_mcdichael said in Starting Chromium to go to a specific site:

          It worked perfectly!
          Thanks!

          M 1 Reply Last reply Reply Quote 0
          • M
            Matt_B50 @prioret
            last edited by

            @prioret hi, a bit off topic but how do you install chromium? Not finding many recent answers on Google.

            S 1 Reply Last reply Reply Quote 1
            • S
              sleve_mcdichael @Matt_B50
              last edited by

              @Matt_B50 chromium is available in the external RetroPie-Extra project:

              https://github.com/Exarkuniv/RetroPie-Extra

              M 1 Reply Last reply Reply Quote 0
              • M
                Matt_B50 @sleve_mcdichael
                last edited by

                @sleve_mcdichael Thank you!

                M 1 Reply Last reply Reply Quote 0
                • M
                  Matt_B50 @Matt_B50
                  last edited by

                  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)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  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.