Skip to content

Instantly share code, notes, and snippets.

@class101
Last active October 14, 2022 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save class101/65f3133b64ba278537ee19fbb3fbb782 to your computer and use it in GitHub Desktop.
Save class101/65f3133b64ba278537ee19fbb3fbb782 to your computer and use it in GitHub Desktop.
Global user_settings.py file for Proton : More informations -> https://steamcommunity.com/sharedfiles/filedetails/?id=2386287653
#!/usr/bin/env python3
"""Settings here will take effect for all games run in this Proton version.
To enable these settings, name this file "user_settings.py"""
# pylint: disable=
import os
def nonzero(string):
"""Check string length."""
return len(string) > 0 and string != "0"
###################
# Global settings #
###################
settings = {
"MANGOHUD": "1",
"PROTON_LOG": "1",
"PROTON_DUMP_DEBUG_COMMANDS": "1",
"PROTON_NO_ESYNC": "1",
"PROTON_NO_FSYNC": "0",
###############
# LOG DEFAULT #
###############
"VKD3D_DEBUG": "none",
"DXVK_LOG_LEVEL": "none",
"WINE_MONO_TRACE": "none",
"WINEDEBUG": "-all,err+all,warn-all,fixme-all",
#############################
# LOG OFFICIAL PROTON_LOG=1 #
#############################
# "VKD3D_DEBUG": "warn",
# "DXVK_LOG_LEVEL": "info",
# "WINE_MONO_TRACE": "E:System.NotImplementedException",
# "WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree",
##############
# LOG CUSTOM #
##############
# "VKD3D_DEBUG": "warn",
# "DXVK_LOG_LEVEL": "info",
# "WINE_MONO_TRACE": "E:System.NotImplementedException",
#
# #### DEFAULT
## "WINEDEBUG": "err+all,warn-all,fixme-all,+debugstr,+mscoree,+msgbox,+loaddll,-module,-seh,\
##-relay,-snoop,-heap,-file,-virtual,-imports,-font,-sync,-fsync,-vulkan,-mfplat,-pulse,-dsound,\
##+winediag,-keyboard,-psdrv,-winspool,-reg,-ver,-ole",
# #### ALL
## "WINEDEBUG": "+all,warn-all,fixme-all,-debugstr,-mscoree,-loaddll,-module,+seh,-relay,-snoop,\
##-heap,-file,-virtual,-imports,-font,-sync,-fsync,-vulkan,-mfplat,-pulse,-dsound,-winediag,\
##-keyboard,-psdrv,-winspool,-reg,-ver",
# "WINEDEBUG": "+all,warn-all,fixme-all,-debugstr,-mscoree,-loaddll,-module,-seh,-relay,-snoop,\
#-heap,-file,-virtual,-imports,-font,-sync,-fsync,-vulkan,-mfplat,-pulse,-dsound,-winediag,\
#-keyboard,-psdrv,-winspool,-reg,-ver",
#"PROTON_NO_XIM": "0", # Enabled by default. Do not attempt to use XIM (X Input Methods) support.
# XIM support is known to cause crashes with libx11 older than version 1.7
#"PROTON_SET_GAME_DRIVE": "0", # Create an S: drive which points to the Steam Library which
# contains the game.
#"PROTON_USE_WINED3D": "0", # Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11,
# d3d10, and d3d9.
#"PROTON_NO_D3D11": "0", # Disable d3d11.dll, for d3d11 games which can fall back to and run
# better with d3d9.
#"PROTON_NO_D3D10": "0", # Disable d3d10.dll and dxgi.dll, for d3d10 games which can fall back to
# and run better with d3d9.
#"PROTON_FORCE_LARGE_ADDRESS_AWARE": "1",
#"PROTON_HIDE_NVIDIA_GPU": "0", # Force Nvidia GPUs to always be reported as AMD GPUs.
# Some games require this if they depend on Windows-only Nvidia
# driver functionality.
# See also DXVK's nvapiHack config, which only affects reporting
# from Direct3D.
#"PROTON_NO_WRITE_WATCH": "0", # Disable support for memory write watches in ntdll.
# This is a dangerous hack and should only be applied if you have
# verified that the game can operate without write watches.
# This improves performance for some very specific games
# (e.g. CoreRT-based games).
#"PROTON_HEAP_DELAY_FREE": "0", # Delay freeing some memory, to work around application
# use-after-free bugs.
#"WINE_FULLSCREEN_INTEGER_SCALING": "0", # Enable integer scaling mode, to give sharp pixels when
# upscaling.
#"LD_PRELOAD": "/home/arno/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so",
#"VKD3D_FEATURE_LEVEL" # "11_0", "11_1", "12_0", "12_1", "12_2"
#"PROTON_USE_D9VK": "0", # DEPRECATED in 5.x
}
#################
# Game settings #
#################
SteamAppId = os.path.basename(os.environ['STEAM_COMPAT_DATA_PATH'].strip('/'))
# Red Dead Redemption 2
# %command% -vulkan
if SteamAppId == '1174180':
custom_settings = {
# []
#"PROTON_HIDE_NVIDIA_GPU": "1",
"WINEDLLOVERRIDES": ""
}
# L.A. Noire
elif SteamAppId == '110800':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Resident Evil Village Gameplay Demo
elif SteamAppId == '1541780':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# KARDS - The WWII Card Game
elif SteamAppId == '544810':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Company of Heroes
# mangohud %command% -nomovies -notriplebuffer
elif SteamAppId == '228200':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": "",
"PROTON_NO_D3D10": "1" # D3D10 is BORKED
}
# Company of Heroes 2
elif SteamAppId == '231430':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Warhammer 40,000: Dawn of War III
elif SteamAppId == '285190':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# RimWorld
elif SteamAppId == '294100':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Oxygen Not Included
elif SteamAppId == '457140':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# The Binding Of Isaac
elif SteamAppId == '250900':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Evil Genius 2
elif SteamAppId == '700600':
custom_settings = {
# []
#
"WINEDLLOVERRIDES": ""
}
# Dwarf Fortress
elif SteamAppId == '3941514469':
custom_settings = {
# []
#
"SteamAppId": "3941514469",
"WINEDLLOVERRIDES": "",
"LD_PRELOAD": ""
}
# Fishing Planet
elif SteamAppId == '380600':
custom_settings = {
# [winegstreamer=d] cause a white screen on startup (seen sometimes on Proton-6.4-GE-1)
#
"WINEDLLOVERRIDES": ""
}
# Total War Warhammer II
elif SteamAppId == '594570':
custom_settings = {
# [*atiadlxx=d;] wrong dll loaded on startup lead to crash
#
"WINEDLLOVERRIDES": "*atiadlxx=d;"
}
# Deep Rock Galatic
elif SteamAppId == '548430':
custom_settings = {
# [mfplat=d] mfplat implementation in Proton-6.1-GE-2
# causes an app hang upon joining multiplayer lobbies
# [mfplat=d] mfplat does not work in Proton-6.3-2
#
"WINEDLLOVERRIDES": "mfplat=d"
}
# Terraria
elif SteamAppId == '105600':
custom_settings = {
"WINEDLLOVERRIDES": "x3daudio1_7=n;xaudio2_6=n;xinput1_3=n;xactengine3_6=n"
}
# Skyrim
elif SteamAppId == '489830':
custom_settings = {
# [xaudio2_7=n,b] sound fix with npc dialogs
#
"WINEDLLOVERRIDES": "xaudio2_7=n,b"
}
# Vortex Mod Manager (non-Steam app)
elif SteamAppId == 'CHANGEME':
custom_settings = {
"SteamAppId": "CHANGEME",
# [fsutil.exe=d] to prevent admin rights checking on startup
# [taskschd=d] to prevent a crash on browsing the Vortex settings
# [ucrtbase=b] to fix a hang on startup with Proton-5.21-GE-1
# (caused because Vortex developers are redistributing ucrtbase.dll
# that is bad practice and dirty because it replaces the one provided by Proton)
# [vulkan-1=b] to fix a hang on startup with Proton-6.4-GE-1
# (caused because Vortex developers are redistributing vulkan-1.dll
# that is bad practice and dirty because it replaces the one provided by Proton)
#
"WINEDLLOVERRIDES": "fsutil.exe=d;taskschd=d;ucrtbase=b;vulkan-1=b",
"LD_PRELOAD": ""
}
# AutoHotkey (non-Steam app)
elif SteamAppId == '2682162712':
custom_settings = {
"SteamAppId": "2682162712",
# []
#
"WINEDLLOVERRIDES": "",
"LD_PRELOAD": ""
}
# Tests
elif SteamAppId == '0':
custom_settings = {
"SteamAppId": "0",
# []
#
"WINEDLLOVERRIDES": ""
}
else:
custom_settings = {}
print("[WARNING] SteamAppId not found in proton_user_settings.py !")
if "PROTON_NO_USERSETTINGS" in os.environ and nonzero(os.environ["PROTON_NO_USERSETTINGS"]):
user_settings = {}
else:
user_settings = dict(settings, **custom_settings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment