protontricks icon indicating copy to clipboard operation
protontricks copied to clipboard

Feature Request: Launch default executable/game launcher

Open t9999clint opened this issue 8 months ago • 4 comments

This might sound a little silly, but I'd like to have a option to launch the default launcher for the game. syntax could be something like... protontricks-launch --appid 208200 --game-launcher

My main usage is to launch games through gamescope without having to configure them in steam. Currently I'm having my script search for the launcher exe from common names, then just by whatever .exe comes first. GameID=208200; GameFolder=$(protontricks -cwd-app -c "echo \"\$STEAM_APP_PATH\"" $GameID 2>/dev/null | tail -1); GameLauncher=$(find "$GameFolder" -type f -name "*.exe" | head -1); scb -- protontricks-launch --appid $GameID --cwd "$GameLauncher"

Not exactly the most elegant. (also won't work with games that need special arguments to launch)

This would also allow custom protrontricks settings be enforced for the standard launcher.

t9999clint avatar Apr 14 '25 03:04 t9999clint

I was also looking for something like this, I guess protontricks would have to read the Steam metadata to figure out its launch arguments and launch options (i.e. if a game has a launcher you'd have to deal with the default option or the other ones available).

Screenshot

I've been working on some completions for Protontricks on Fish shell so if supports for checking launchers goes through it'd be nice to add that to autocompletion.

luluco250 avatar Apr 15 '25 13:04 luluco250

I've pushed a preliminary implementation into the game-launcher branch. It's incomplete though and there are two issues which I'd like to solve before pushing it to master:

  • There doesn't seem to be a single way to declare a launch option as the default in appinfo.vdf metadata, where the launch options are located. Or maybe I haven't looked hard enough yet. Currently Protontricks pretty much makes an educated guess.
  • When the user selects a non-default launch option via the Steam app properties as in your screenshot, this selection is stored in user's config file with a hex string -> numeric index mapping. However, the index doesn't map directly to a full list of launch options. And second, I don't know how the hex string is derived. It's stored in an object, so my guess it's there to tell different game versions apart (eg. when a game update adds/removse/changes launch options). It's also a 32-bit hex string, so it might be a CRC32 checksum or something similar?
    • The non-default launch option looks like this in ~/.steam/steam/userdata/<userid>/config/localconfig.vdf:
      "38410"
      		{
      			"DefaultLaunchOption"
      			{
      				"ba0628a6"		"1"
      			}
      		}
      

If you want to give it a shot, you can install the dev branch using pipx like this:

$ pipx install git+https://github.com/Matoking/protontricks.git@game-launcher

Matoking avatar Apr 27 '25 18:04 Matoking

I have a bit more time on my hands than before, I can test some of this out for you if you'd like.

What's the recommended syntax? is it just protontricks-launch --appid <APPID> --game-launcher like I suggested, or something else?

Also, thanks for taking a look into my sorta silly request. This is the last little bit that I just couldn't figure out for a simple yad powered gui frontend I was working on to make gamescope easier to use. (Usage of script: auto searches and lists all installed steam/heroic/lutris games, select game, it pops up with a gamescope command in a simple run-dialog box, you click run, and BAM! gamescope running your selected game.)

t9999clint avatar May 02 '25 04:05 t9999clint

The command to use is protontricks --game-launch <appid>.

protontricks-launcher is used for launching external executables selected by the user (eg. via the file manager).

Matoking avatar May 03 '25 09:05 Matoking