sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.13k stars 71 forks source link

Use as CLI #1057

Closed Mte90 closed 6 months ago

Mte90 commented 6 months ago

Feature Description

Right now the whole script is executed if you include it in a bash script. What I am looking for is a way to use some functions or some parameters, like a way to generate a config file for a specific game.

My user case is very simple:

In this way I don't need to setup always for everygame the same stuff with a different path (with all the issues on steamdeck that we know).

Right now I was thinking to embed STL in another bash file and use it, I guess that createGameCfg or createDefaultCfgs with updateConfigEntry.

Mte90 commented 6 months ago

Nevermind the tool has a CLI interface.

sonic2kk commented 6 months ago

Yup, we do indeed already have a commandline usage. I mostly use STL from the commandline these days actually. Things like this are very useful to me for opening compatdata paths: xdg-open "$( steamtinkerlaunch gc "Sonic Adventure" | head -n1 | cut -d '>' -f2 )".

As SteamTinkerLaunch is a Bash script, a lot of the functionality is first written as a commandline feature, and then there's a UI that takes information in from the GUI and passes it to the function that the commandline would call. A good example of this is how we handle One-Time Run and adding Non-Steam Games.

Right now the whole script is executed if you include it in a bash script. [...] Right now I was thinking to embed STL in another bash file and use it

This kind of usage isn't really supported, the commandline usage is preferred. This is what various downstream projects are already doing, the one I'm most aware of as the maintainer has had some good discussions here, is this: https://github.com/trentondyck/horizon_scripts/blob/0c47c8ee02faa68d50ea15d544f5e635cdf19414/install-or-update-horizon.sh#L164

Using SteamTinkerLaunch as a command instead of scripts is the way to go instead of trying to embed it. I think you already got this, but just wanted to leave a clarifying comment :-)


The commandline usage on SteamOS isn't great right now, because of all the attempting-to-update shenanigans. But on Desktop, at least imo, it works well! :smile: