protonscr

[Question] It's possible use non default envar on user_settings.py?

protonclosed
ValveSoftware/Proton#3553 · opened 2020-02-22 by ltsdw · updated 2020-02-23 · 4 comments · github
4 matching comments, n / p to jump
Lltsdw 2020-02-22 github

Proton Version: 5.0.1
Game: The Elder Scrolls Online (non-steam)

So I was trying set some envars in user_settings.py and some of them isn't working, like:

"DXVK_CONFIG_FILE": "my-home-path/Games/DXVK-CONFIG/dxvk.conf",
"DXVK_STATE_CACHE_PATH": "my-home-path/Games/DXVK-STATE-CACHE",

But it's seems isn't working... So, is this the expected behavior or am I setting them wrong? (the others envars, the defaults one, are working just fine)

Ppchome 2020-02-23 github

Try this:

import os
os.environ["DXVK_CONFIG_FILE"] = "my-home-path/Games/DXVK-CONFIG/dxvk.conf"
os.environ["DXVK_STATE_CACHE_PATH"] = "my-home-path/Games/DXVK-STATE-CACHE"

Append to the end of the config file, not into the user_settings list.

Lltsdw 2020-02-23 github

So, I'm a bit confused, was it to me append at the end of user_settings.py like this
user_settings.py.txt? (because isn't working). I've read a bit about os.environ of python... and it should work like it is right now... I don't know why isn't working.

Ppchome 2020-02-23 github

Then maybe this instead:

from __main__ import g_session
g_session.env["DXVK_CONFIG_FILE"] = "my-home-path/Games/DXVK-CONFIG/dxvk.conf"
g_session.env["DXVK_STATE_CACHE_PATH"] = "my-home-path/Games/DXVK-STATE-CACHE"

see https://github.com/ValveSoftware/Proton/blob/64f0fc755988cd2e7a8ad3c593db617534b8c17d/proton#L368-L371
https://github.com/ValveSoftware/Proton/blob/64f0fc755988cd2e7a8ad3c593db617534b8c17d/proton#L717

Or try https://github.com/simons-public/protonfixes, where you can do whatever you want using python, e.g. create ~/.config/protonfixes/localfixes/default.py and add:

import os
from protonfixes import util

def main():
    """ local defaults
    """

    # My env
    util.set_environment('DXVK_CONFIG_FILE', os.path.expanduser('~/Games/DXVK-CONFIG/dxvk.conf'))
    util.set_environment('DXVK_STATE_CACHE_PATH', os.path.expanduser('~/Games/DXVK-STATE-CACHE'))

Lltsdw 2020-02-23 github

Then maybe this instead:

from __main__ import g_session
g_session.env["DXVK_CONFIG_FILE"] = "my-home-path/Games/DXVK-CONFIG/dxvk.conf"
g_session.env["DXVK_STATE_CACHE_PATH"] = "my-home-path/Games/DXVK-STATE-CACHE"

This one work just fine, thank you.

Launch options