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

    Run steam games from Retropie/Execute .desktop files

    Scheduled Pinned Locked Moved Help and Support
    steamxfgxfg-opendesktop-files
    13 Posts 3 Posters 2.0k 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.
    • A
      abaaihd
      last edited by abaaihd

      Hello all,
      I've been using this forum for a long time, but now I've registered because I can't solve a problem.
      I am setting up retropie in linux (Linux Mint) and want to be able to launch my Steam games via Emulationstation. I found what I was looking for here: https://ericslenk.com/posts/running-steam-games-from-emulationstation.
      It creates .desktop files of my installed games through a script. I can start these in Linux on this way. But if I now want to open a game from RetroPie the file is always opened with text editing. The entry in es_systems.cfg looks like this:

      <system>
      <name>steam</name>
      <fullname>Steam</fullname>
      <path>/home/archibald/RetroPie/roms/steam</path>
      <extension>.desktop</extension>
      <command>xdg-open %ROM%</command>
      <platform>pc</platform>
      <theme>steam</theme>
      </system>

      The problem is probably because retropie/emulationstation ignores the xdg-open rules. I tried to read into the topic, but didn't find how to get Retropie to use these like in Linux.

      Has anyone tried to use Steam games this way and have a solution? E.g. give the command xdg-open more information so that the file is executed?

      Thanks in advance.

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @abaaihd
        last edited by

        text editing. The entry in es_systems.cfg looks like this:

            <name>steam</name>
            <fullname>Steam</fullname>
            <path>/home/archibald/RetroPie/roms/steam</path>
            <extension>.desktop</extension>
            <command>xdg-open %ROM%)</command>
            <platform>pc</platform>
            <theme>steam</theme>
          </system>
        

        You have a typo in the definition above, I think it should be

        <command>xdg-open %ROM%</command>
        

        The problem is probably because retropie/emulationstation ignores the xdg-open rules.

        No, that's not the problem. EmulationStation just tries to run the command as instructed and that's it - it has no knowledge of how the program it started is working.

        If you run xdg-open <path-to-desktop-file> from a command line, is the game starting OK ?

        A 1 Reply Last reply Reply Quote 0
        • A
          abaaihd @mitu
          last edited by abaaihd

          @mitu Thanks for your reply. The spelling error was a problem, but it crept in while I was trying around. So it is not THE reason.
          When I open xdg... via the console, the file is also opened with the text editor.
          I also tried to change the parameter Terminal in the .desktop file to true. Then terminal was only greyes out but the file was not opened in editor.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            Can you try using gtk-launch instead of xdg-open ?

            A 1 Reply Last reply Reply Quote 0
            • A
              abaaihd @mitu
              last edited by

              @mitu It says that there is no such application:
              gtk-launch: no such application /home/...

              1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator
                last edited by

                I guess gtk-launch doesn't launch arbitray .desktop files, but expects just the name of the shortcut and searches in the known application locations.

                Why don't you create a launch script (.sh) instead of a .desktop file and add the launching command there ?

                A 1 Reply Last reply Reply Quote 0
                • A
                  abaaihd @mitu
                  last edited by

                  @mitu Thanks, i'll give it a try. Is there a published solution for this? On the threads i found there were issues to closing the game and get automatically back to emulationstation.
                  Just found out xdg-open is broken. So this won't work until the bug is fixed.

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @abaaihd
                    last edited by

                    Is there a published solution for this?

                    None that I know. AFAIK Pegasus has a Steam integration/import module, and I think it uses the same command from the generated .desktop files (steam steam://rungameid/${app_id}) to launch Steam games.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      abaaihd @mitu
                      last edited by

                      @mitu Thank you. Here is also the problem that after finishing a game in steam emulationstation is not automatically reopened. But this is probably only to solve when steam has been improved here. Requests were made by the team around pegasus.
                      When editing my settings for the automatic start of kodi when opening Retropie (https://retropie.org.uk/forum/topic/23998/where-is-autostart-sh), however, I noticed that the automatic opening of Retropie at system startup is controlled via the file /home/"username"/.config/autostart/retropie.desktop. Which command is used to start it? I could not locate this, but was wondering if I could transfer this to the entry for steam in es_systems.cfg. However, while I was writing this, I realized that I would have to do some research on the part of the os.

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @abaaihd
                        last edited by

                        @abaaihd said in Run steam games from Retropie/Execute .desktop files:

                        Which command is used to start it?

                        You can open the .desktop file with a text editor and see the launch command (for any such file). RetroPie is started with

                        gnome-terminal --full-screen --hide-menubar -e emulationstation
                        
                        A 1 Reply Last reply Reply Quote 0
                        • A
                          abaaihd @mitu
                          last edited by

                          @mitu I have already edited this file to run an autostart.sh which then starts kodi directly.
                          I wanted to point out how on the part of linux the .desktop file is executed at system start. For me this is only executed by a double click and otherwise it is only opened. So my thought was that I could look at how the .desktop file is executed when linux starts (obviously not via a double click) and I could add this command to the es_systems.cfg.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @abaaihd
                            last edited by

                            @abaaihd said in Run steam games from Retropie/Execute .desktop files:

                            I wanted to point out how on the part of linux the .desktop file is executed at system start

                            The location of the file ($HOME/.config/autostart) tells the desktop manager to start the application automatically when you login to your desktop session.

                            1 Reply Last reply Reply Quote 0
                            • R
                              rael_gc
                              last edited by

                              Basically what I'm doing to launch is to configure the platform like this:

                              <system>
                                  <name>steam</name>
                                  <fullname>Steam</fullname>
                                  <path>~/RetroPie/roms/steam</path>
                                  <extension>.dat</extension>
                                  <command>steam steam://rungameid/`cat %ROM%`</command>
                                  <platform>pc</platform>
                                  <theme>steam</theme>
                              </system>
                              

                              And then in the Steam ROMs folder, saving the game id in a .cat file.

                              Like @abaaihd said, the only issue is when exiting the game, as Steam will be minimized and EmulationStation will loose focus.

                              @abaaihd Did you get able to get back to ES after exit any Steam game?

                              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.