this post was submitted on 10 Jul 2025
5 points (100.0% liked)

Linux Gaming

19051 readers
10 users here now

Gaming on the GNU/Linux operating system.

Recommended news sources:

Related chat:

Related Communities:

Please be nice to other members. Anyone not being nice will be banned. Keep it fun, respectful and just be awesome to each other.

founded 5 years ago
MODERATORS
 

I'm on Nobara 42 and use the pre-installed Lutris.

I'm trying to use pre-launch and post-exit scripts with Lutris. My script looks like this: echo "pre launch" > /home/me/Documents/lutris.txt and creates the textfile when I run it manually.
I set the full path to the script in a game as a Pre-launch script and toggled Wait for pre-launch script completion to on.
The game just launches normally when I click play and the text-file is not created.

Can anyone tell me what I'm doing wrong?

top 6 comments
sorted by: hot top controversial new old
[–] ferric_carcinization@lemmy.ml 4 points 1 week ago (1 children)

Does the script file have a shebang? (Something like #!/bin/sh as the first line)

[–] ackthxbye@feddit.org 3 points 1 week ago (1 children)

That's what was missing. Thank you!

[–] ferric_carcinization@lemmy.ml 1 points 1 week ago

So it works now? If so, then glad to be of help.

Just remember that if your shebang points to sh, you can't rely on bash-specific features. The shebang line basically tells the kernel to run your file with the specified program. So, for example, a file with #!/bin/cat will print the full contents of the file (including the shebang) and #!/bin/echo will print the command line. (something like ./script arg1 arg2) As the echo command does not try to interpret arguments as paths, the content of the script would be ignored in that case.

[–] INeedMana@piefed.zip 3 points 1 week ago (1 children)

Do you have space in the path of your script?

Is it executable?

[–] ackthxbye@feddit.org 1 points 1 week ago (1 children)

There is no space in the path.

And it is executable, if I paste the exact line from the config-dialog into a terminal the script runs as expected and creates the text-file.

[–] INeedMana@piefed.zip 1 points 1 week ago

Just to be sure: this is a script, right? Sitting somewhere? Not just a command put directly in the config?

I think you might have to ask in https://github.com/lutris/lutris/issues I'm out of ideas