1 diff --git a/bin/mangohud.in b/bin/mangohud.in
2 index 53c72ef..18240ea 100755
6 DISABLE_LD_PRELOAD="cs2.sh
9 -MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so"
10 +LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
11 +XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
12 +MANGOHUD_LIB_NAME="libMangoHud_opengl.so"
14 if [ "$1" = "--dlsym" ]; then
15 - MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
16 + MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
17 shift # shift will only be executed if $1 is "--dlsym"
18 elif [ "$MANGOHUD_DLSYM" = "1" ]; then
19 - MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
20 + MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
23 if [ "$1" = "--version" ]; then
24 @@ -41,7 +43,7 @@ for exe in $DISABLE_LD_PRELOAD; do
27 if [ "$disable_preload" = true ]; then
28 - exec env MANGOHUD=1 "$@"
29 + exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
31 # Make sure we don't append mangohud lib multiple times
32 # otherwise, this could cause issues with the steam runtime
33 @@ -54,5 +56,5 @@ else
34 LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
37 - exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
38 + exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"