Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Allow mangohud to find its config file again #2841

Merged
19 changes: 18 additions & 1 deletion src/backend/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,30 @@ function setupWineEnvVars(gameSettings: GameSettings, gameId = '0') {
case 'crossover':
ret.CX_BOTTLE = wineCrossoverBottle
}

if (gameSettings.showFps) {
isMac ? (ret.MTL_HUD_ENABLED = '1') : (ret.DXVK_HUD = 'fps')
}
if (gameSettings.enableDXVKFpsLimit) {
ret.DXVK_FRAME_RATE = gameSettings.DXVKFpsCap
}
if (
gameSettings.showMangohud &&
!gameSettings.enviromentOptions.find(
({ key }) => key === 'MANGOHUD_CONFIGFILE'
)
) {
if (!process.env.XDG_CONFIG_HOME) {
ret.MANGOHUD_CONFIGFILE = join(
flatPakHome,
'.config/MangoHud/MangoHud.conf'
)
} else {
ret.MANGOHUD_CONFIGFILE = join(
process.env.XDG_CONFIG_HOME,
'MangoHud/MangoHud.conf'
)
}
}
if (gameSettings.enableEsync && wineVersion.type !== 'proton') {
ret.WINEESYNC = '1'
}
Expand Down