Steam – Set same steam launch options for all games

steam

I've found an incantation that gives me better FPS in all games (that I've tried so far):

mesa_glthread=true R600_DEBUG=sbcl,hyperz,llvm,sisched,forcedma %command%

What I'd like to do is set this as a launch option for every game. It's a pain setting it for each game [1], I have 45, shared across 3 family members – potentially 135 settings. If I want to change all the settings because I find a better launch option (or change my graphics card, say) then I'll need to redo them all.

So, is it possible to make Steam use the same launch options for all games in my library?

I'm on Kubuntu 17.10 using a Kaveri AMDGPU, fwiw.

[1] – find game in library, right-click, choose properties, choose "set launch options", paste in options code, OK, OK.

Best Answer

Launch options are stored in the file Steam/userdata/{Steam3::accountID}/config/localconfig.vdf for each user (Steam3::accountID is a specific user).

This file is in Valve's own proprietary Text-VDF KeyValue file format which is also used in Steam skins. It is similar enough to JSON and other object-based data formats though that it can pretty easily be converted back-and-forth as with Rossen Georgiev's vdf-parser which supports both PHP & JavaScript (I have my own tweaked fork at simple-vdf2 -- removed PHP script, it now uses JS async/await, has tests & code coverage reporting, and uses Standard JS style), and leovp's steamfiles for Python (no idea if this works as I do not use Python, but there are some other VDF libs too). There is also a binary VDF format, but that's far more complex and not necessary to even consider for what you want to do here.

With the data converted to JSON you would find the following [partial] format in the file localconfig.vdf:

"UserLocalConfigStore"
{
    "Software"
    {
        "Valve"
        {
            "Steam"
            {
                "Apps"
                {
                    "STEAM_APPID"
                    {
                        "LaunchOptions"     "LAUNCH_OPTIONS_VALUE"
                    }
                }
            }
        }
    }
}

Where {STEAM_APPID} is an appid of an app on Steam and {LAUNCH_OPTIONS_VALUE} is whatever you've set as the launch options. If you have not set any value then the "LaunchOptions" key may not exist as Steam does not allow many empty key-value pairs to stay in the config files (it cleans up when loading/saving the files).

You can edit this file without converting it if you do so carefully -- the VDF format uses tabs instead of spaces, and there has to be two tabs between a key and a value for it to be properly parsed when loaded, and if Steam doesn't properly parse a file when loading it the result can range from ignoring the single section/entry that had an issue to ignoring the entire file or even destroying the data and either generating a new copy of the file which will not include your personal settings/information or downloading the latest version from the Steam Cloud.