Heroic-Games-Launcher / HeroicGamesLauncher

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
https://heroicgameslauncher.com
GNU General Public License v3.0
8.05k stars 423 forks source link

With "MANGOHUD=1", Heroic behaves like the option inside Heroic is set to 1 and uses its own config file #2922

Closed NerosTie closed 11 months ago

NerosTie commented 1 year ago

Describe the bug

In the case where the user has "MANGOHUD=1" in /etc/environment or launch Heroic with "MANGOHUD=1 heroic", Heroic behaves like the option inside Heroic is set to 1 and uses its own config file. It's not an expected behavior.

In my case, I have "MANGOHUD=1" in /etc/environment to have Mangohud everywhere with my config file. If I run Heroic in this situation, when I launch a game Mangohud is here but not using my config file, it's a default config file instead.

This issue doesn't exist in Heroic 2.8.0.

Add logs

MANGOHUD=1 heroic                                                                                                  

DevTools listening on ws://127.0.0.1:9222/devtools/browser/0f546688-1b27-4a42-a4ce-9e2f4ef379b1
(09:46:20) INFO:    [Legendary]:        Running command: XDG_CONFIG_HOME=/home/neros/.config/heroic/legendaryConfig /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary --version
[2023-07-28 09:46:20.029] [MANGOHUD] [info] [config.cpp:118] skipping config: '/opt/Heroic/MangoHud.conf' [ not found ]
[2023-07-28 09:46:20.029] [MANGOHUD] [info] [config.cpp:118] skipping config: '/home/neros/.config/MangoHud/heroic.conf' [ not found ]
[2023-07-28 09:46:20.029] [MANGOHUD] [info] [config.cpp:123] parsing config: '/home/neros/.config/MangoHud/MangoHud.conf'
(09:46:20) INFO:    [Legendary]:        Legendary location: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary
(09:46:20) INFO:    [Gog]:              GOGDL location: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/gogdl
(09:46:20) INFO:    [Connection]:       Connectivity: check-online
(09:46:20) INFO:    [Connection]:       Pinging external endpoints
(09:46:20) INFO:    [Backend]:          DRM module staus {
  oimompecagnajdejgnnjijobebaeigek: {
    name: 'Widevine Content Decryption Module',
    status: 'new',
    version: '4.10.2557.0'
  }
}
APPIMAGE env is not defined, current application is not an AppImage
(09:46:20) WARNING: [Backend]:          Protocol already registered.
(09:46:20) INFO:    [Connection]:       Connectivity: online
(09:46:20) INFO:    [Gog]:              Checking if login is valid
(09:46:20) INFO:    [Gog]:              Running command: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/gogdl --auth-config-path /home/neros/.config/heroic/gog_store/auth.json auth
(09:46:20) INFO:    [Gog]:              Running command: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/gogdl --auth-config-path /home/neros/.config/heroic/gog_store/auth.json --version
(09:46:20) INFO:    [Backend]:          AreWeAntiCheatYet data downloaded
(09:46:20) INFO:    [Nile]:             Running command: XDG_CONFIG_HOME=/home/neros/.config/heroic/nile_config /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/nile --version
(09:46:20) INFO:    [Backend]:          Loading Screen Ready
(09:46:20) INFO:    [Frontend]:         Refreshing undefined Library
(09:46:20) WARNING: [Backend]:          refresh not implemented on Sideload Library Manager
(09:46:20) INFO:    [Gog]:              Running command: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/gogdl --auth-config-path /home/neros/.config/heroic/gog_store/auth.json auth
(09:46:20) INFO:    [Legendary]:        Refreshing library...
(09:46:20) INFO:    [Legendary]:        Refreshing Epic Games...
(09:46:20) INFO:    [Legendary]:        Game list updated, got 211 games & DLCs
(09:46:20) INFO:    [Backend]:          Frontend Ready
(09:46:20) INFO:    [Gog]:              Saved username to config file
(09:46:20) INFO:    [Legendary]:        Running command: XDG_CONFIG_HOME=/home/neros/.config/heroic/legendaryConfig /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary list --third-party
/bin/sh: ligne 1: hostname : commande introuvable
(09:46:20) INFO:    [Backend]:          Checking for current version changelog
(09:46:20) INFO:    [Gog]:              Getting GOG library
(09:46:20) INFO:    [Gog]:              Running command: /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/gogdl --auth-config-path /home/neros/.config/heroic/gog_store/auth.json auth
(09:46:20) INFO:    [Backend]:          

Heroic Version: 2.9.1 Boa Hancock
Legendary Version:  0.20.32 Dark Energy (hotfix #6)
GOGdl Version: 0.7.3
Nile Version: 1.0.0 Jonathan Joestar

Electron Version: 24.4.1
Chrome Version: 112.0.5615.204
NodeJS Version: 18.14.0

OS: Arch KERNEL: 6.4.6-zen1-1-zen ARCH: x64
CPU: AMD Ryzen 5 3600 6-Core Processor @3.6 GOVERNOR: schedutil
RAM: Total: 31.27 GiB Available: 22.02 GiB
GRAPHICS: GPU0: AMD Radeon RX 6600 XT VRAM: 8176MB 
PROTOCOL: wayland

(09:46:22) INFO:    [Backend]:          Launching The Dungeon Of Naheulbeuk: The Amulet Of Chaos (02fac38ee2614c8ba276b1ea7c1acd7c)
(09:46:22) INFO:    [Backend]:          Preventing display from sleep
(09:46:22) INFO:    [Backend]:          Checking if wine version exists: Wine - lutris-GE-Proton8-12-x86_64
(09:46:22) INFO:    [Backend]:          Preventing machine to sleep
(09:46:22) INFO:    [Backend]:          Stopping Power Saver Blocker
(09:46:22) INFO:    [Winetricks]:       Downloading Winetricks
(09:46:22) INFO:    [Backend]:          Checking if wine version exists: Wine - lutris-GE-Proton8-12-x86_64
(09:46:22) INFO:    [Backend]:          Checking if wine version exists: Wine - lutris-GE-Proton8-12-x86_64
(09:46:22) INFO:    [Backend]:          Checking if wine version exists: Wine - lutris-GE-Proton8-12-x86_64
(09:46:22) DEBUG:   [Backend]:          Running Wine command: wineboot --init
(09:46:23) INFO:    [Gog]:              Saved games data
(09:46:23) WARNING: [Backend]:          listUpdateableGames not implemented on Sideload Library Manager
(09:46:23) INFO:    [Gog]:              Found 0 game(s) to update
(09:46:23) INFO:    [Legendary]:        Checking for game updates: XDG_CONFIG_HOME=/home/neros/.config/heroic/legendaryConfig /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary list --third-party
(09:46:23) INFO:    [DXVKInstaller]:    installing dxvk on... /home/neros/Jeux/Heroic/compatdata/The Dungeon Of Naheulbeuk The Amulet Of Chaos
(09:46:23) INFO:    [DXVKInstaller]:    dxvk already installed!
(09:46:23) INFO:    [DXVKInstaller]:    installing vkd3d on... /home/neros/Jeux/Heroic/compatdata/The Dungeon Of Naheulbeuk The Amulet Of Chaos
(09:46:23) INFO:    [DXVKInstaller]:    vkd3d already installed!
(09:46:23) INFO:    [Legendary]:        Launching The Dungeon Of Naheulbeuk: The Amulet Of Chaos: LD_PRELOAD= WINEPREFIX="/home/neros/Jeux/Heroic/compatdata/The Dungeon Of Naheulbeuk The Amulet Of Chaos" WINEDLLOVERRIDES=winemenubuilder.exe=d WINE_FULLSCREEN_FSR=0 WINEESYNC=1 WINEFSYNC=1 ORIG_LD_LIBRARY_PATH= LD_LIBRARY_PATH=/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib64:/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib GST_PLUGIN_SYSTEM_PATH_1_0=/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib64/gstreamer-1.0:/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib/gstreamer-1.0 WINEDLLPATH=/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib64/wine:/home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/lib/wine XDG_CONFIG_HOME=/home/neros/.config/heroic/legendaryConfig /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary launch 02fac38ee2614c8ba276b1ea7c1acd7c --language fr --wine /home/neros/.local/share/lutris/runners/wine/lutris-GE-Proton8-12-x86_64/bin/wine
(09:46:24) INFO:    [Legendary]:        Found 0 games to update
(09:46:25) INFO:    [Backend]:          Starting the Download Queue
(09:46:29) INFO:    [Backend]:          Stopping Display Power Saver Blocker
(09:46:29) INFO:    [Frontend]:         Refreshing legendary Library
(09:46:29) INFO:    [Legendary]:        Refreshing library...
(09:46:29) INFO:    [Legendary]:        Refreshing Epic Games...
[200774:0728/094629.964912:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
(09:46:30) INFO:    [Legendary]:        Game list updated, got 211 games & DLCs
(09:46:30) INFO:    [Legendary]:        Running command: XDG_CONFIG_HOME=/home/neros/.config/heroic/legendaryConfig /opt/Heroic/resources/app.asar.unpacked/build/bin/linux/legendary list --third-party

Steps to reproduce

  1. Edit the file .config/MangoHud/MangoHud.conf to have something different from default
  2. Set "MANGOHUD=1" to /etc/environment or launch Heroic with "MANGOHUD=1 heroic"
  3. Launch a game
  4. Heroic uses its own config file

Expected behavior

Heroic shouldn't bypass the user's config file for Mangohud when MANGOHUD=1

Screenshots

No response

Heroic Version

Latest Stable

System Information

Additional information

Only with games from the Epic Store, no issue with games from GOG.

Trevonn commented 1 year ago

I have this bug too. The reason is because of the code linked below.

https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/blob/1020e7e2d6fb5379613f8d96b3d61036c7cb0d00/src/backend/launcher.ts#L409

Trevonn commented 1 year ago

2841 is the offending commit.

globally set MANGOHUD_CONFIGFILE is ignored because of the code.

syslinking XDG_CONFIG_HOME/MangoHud/MangoHud.conf to my config file fixes the issue

alterNERDtive commented 1 year ago

syslinking XDG_CONFIG_HOME/MangoHud/MangoHud.conf to my config file fixes the issue

What exactly did you link from where to where? Cause just setting an explicit XDG_CONFIG_HOME doesn’t work, and this issue is quite annoying given that it also doesn’t load vkBasalt configs.

Etaash-mathamsetty commented 12 months ago

working on trying to resolve the XDG_CONFIG_HOME overrides, I fixed it with nile so far, legendary is waiting on a PR

Etaash-mathamsetty commented 12 months ago

this should fix it for yall: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/pull/3137

alterNERDtive commented 12 months ago

TYVM :+1:

myned commented 11 months ago

syslinking XDG_CONFIG_HOME/MangoHud/MangoHud.conf to my config file fixes the issue

What exactly did you link from where to where? Cause just setting an explicit XDG_CONFIG_HOME doesn’t work, and this issue is quite annoying given that it also doesn’t load vkBasalt configs.

In lieu of the fix being merged (much appreciated!), the exact symlink for MangoHUD is:

ln -s ~/.config/MangoHud ~/.config/heroic/legendaryConfig/

For vkBasalt, it would likely be:

ln -s ~/.config/vkBasalt ~/.config/heroic/legendaryConfig/

This is because XDG_CONFIG_HOME is set to ~/.config/heroic/legendaryConfig by Heroic during game runtime, at least on my system according to the logs.

arielj commented 11 months ago

This should be fixed now in heroic 2.10.0 since we don't use the XDG_CONFIG_HOME env anymore