Launch Steam games from Lutris - for purists :)

Hi all,

User profpyrus on GitHub wrote a little script, which I updated for my needs (link to this GitHub thread is here). What it does is it starts on game launch (from Lutris), keeps monitoring Steam game related processes and shuts down Steam when player exitst the game. What it cannot do is work with launching multiple games from Steam. This only on per only one game launch > quit basis.

  1. Prerequisites:
    Some basic knowledge of how Lutris and Steam for Linux work, not necessarily in conjuction with each other. Also installing all associated sources and runners would help greatly :wink:

  2. Add -silent -nochatui -nofriendsui in Steam runner > Runner options > arguments. It helps launch steam in the background without all of those annoying windows popping up.

  3. Create .sh file with the name of your choosing. Paste script content:

#!/bin/bash
# Waits until steam is no longer running any games, then closes it.

while [ -z $(pgrep -x steam) ]
do
    sleep 10
done
while [ -z $(pgrep -x reaper) ]
do
    sleep 10
done
while [ ! -z $(pgrep -x reaper) ]
do
    sleep 10
done
pkill steam &
  1. Save file and add link to this file in Steam runner > System options > Pre-launch script.
  2. Open Steam and install you favourite games, set up controllers, etc. Don’t forget to add gamemoderun %command% in game launch options for every installed game (if you have Feral Game Mode installed at that).
  3. Install those same games in Lutris from Steam source.
  4. Launch game, play and quit to see whether or not Steam was closed after you quit the game.

PS. I’m on Linux Mint 22 Cinnamon edition. This is the only platform I tested it on, FYI.

Hope it’ll help anyone. Cheers.