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

    What is this script doing?

    Scheduled Pinned Locked Moved Help and Support
    steam
    2 Posts 2 Posters 334 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.
    • W
      WhiteT982
      last edited by

      I’ve been trying to get steam to close when I exit a steam game in Emulationstation using this script.

      
      #!/bin/bash
      # steamlaunch
      
      steam -silent -applaunch $1 2>&1 | tee >(
        while read line; do
          if [[ $line == *"Game process removed: AppID $1"* ]]; then
            sleep 10; steam -shutdown; break
          fi
        done
      )
      
      

      It works sometimes and have been trying to troubleshoot why it doesn’t work all of the time? It seems to work better if I open emulationstation and only launch the steam game and then exit. If I launch some other game and exit then launch the steam game it hangs and won’t exit back to emulationstation. Specifically wondering what this part is doing?

      
      $1 2>&1 | tee >(
      
      

      Pulled it from here which says:
      Used tee >( ... ) to allow the output to continue to STDOUT

      L 1 Reply Last reply Reply Quote 0
      • L
        lizardwiz @WhiteT982
        last edited by

        @WhiteT982 $1 is passing the 1st parameter (probably your steam game) to the "steam" command.

        &2>1 is redirecting stderr to stdout (so you can see if an error occurs while reading stdout).

        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.