diff --git a/README.md b/README.md index 834d3c9f..b87b9166 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,8 @@ Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_s Because comma is also used as option delimiter and needs to be escaped for values with a backslash, you can use `+` like `MANGOHUD_CONFIG=fps_limit=60+30+0` instead. Note: Width and Height are set automatically based on the font_size, but can be overridden. + +Note: RAPL is currently used for Intel CPUs to show power draw with `cpu_power` which may be unreadable for non-root users due to [vulnerability](https://platypusattack.com/). The corresponding `energy_uj` file has to be readable by corresponding user, e.g. by running `chmod o+r /sys/class/powercap/intel-rapl\:0/energy_uj` as root, else the power shown will be *0 W*, though having the file readable may potentially be a security vulnerability persisting until system reboots. ## Vsync ### OpenGL Vsync - `-1` = Adaptive sync diff --git a/bin/MangoHud.conf b/bin/MangoHud.conf index 05c40171..99c7e443 100644 --- a/bin/MangoHud.conf +++ b/bin/MangoHud.conf @@ -5,13 +5,13 @@ ################ PERFORMANCE ################# -### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless v-synced). +### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless VSynced). # fps_limit= -### VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on +### VSync [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on # vsync= -### OpenGL VSYNC [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a fps limiter (fps = display refresh rate / N) +### OpenGL VSync [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a FPS limiter (FPS = display refresh rate / N) # gl_vsync= ################### VISUAL ################### @@ -19,8 +19,8 @@ ### Custom text centered useful for a header # custom_text_center = -### Legacy Layout -legacy_layout +### Legacy layout +# legacy_layout = false ### Display the current CPU information cpu_stats @@ -47,6 +47,7 @@ gpu_stats ### Display FPS and frametime fps +# fps_sampling_period= frametime ### Display loaded MangoHud architecture @@ -71,7 +72,7 @@ frame_timing ### Time formatting examples # time_format = %H:%M # time_format = [ %T %F ] -# time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. japanese) +# time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. Japanese) ### Change the hud font size (default is 24) font_size=24 @@ -109,10 +110,12 @@ position=top-left # swap # vram -### Display Wine version +### Display MangoHud, engine or Wine version +# version +# engine_version # wine -### Disable / hide the hud by deafult +### Disable / hide the hud by default # no_display ### Hud position offset @@ -152,25 +155,25 @@ background_alpha=0.5 # pci_dev = 0:0a:0.0 ### Blacklist -#blacklist = +# blacklist = ################## INTERACTION ################# ### Change toggle keybinds for the hud & logging -#toggle_hud=Shift_R+F12 -#toggle_fps_limit=Shift_L+F1 -#toggle_logging=Shift_L+F2 -#reload_cfg=Shift_L+F4 -#upload_log=Shift_L+F3 +# toggle_hud=Shift_R+F12 +# toggle_fps_limit=Shift_L+F1 +# toggle_logging=Shift_L+F2 +# reload_cfg=Shift_L+F4 +# upload_log=Shift_L+F3 ################## LOG ################# ### Automatically start the log after X seconds # autostart_log = 1 -### Set amount of time in second that the logging will run for +### Set amount of time in seconds that the logging will run for # log_duration -### Set location of the output files (Required for logging) +### Set location of the output files (required for logging) # output_folder = /home//mangologs -### Permit uploading logs directly to Flightlessmango.com +### Permit uploading logs directly to FlightlessMango.com # permit_upload=1 ### Define a '+'-separated list of percentiles shown in the benchmark results. ### Use "AVG" to get a mean average. Default percentiles are 97+AVG+1+0.1 diff --git a/bin/mangohud.in b/bin/mangohud.in index 36ecb9d1..7aa70db7 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -19,7 +19,7 @@ if [ "$MANGOHUD_DLSYM" = "1" ]; then MANGOHUD_LIB_NAME="@ld_libdir_mangohud_abs@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" fi -# Preload using the plain filesnames of the libs, the dynamic linker will +# Preload using the plain filenames of the libs, the dynamic linker will # figure out whether the 32 or 64 bit version should be used, and will search # for it in the correct directory LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" diff --git a/bin/run-mangohud-gl-pkg.sh b/bin/run-mangohud-gl-pkg.sh index b8702593..a09ac514 100755 --- a/bin/run-mangohud-gl-pkg.sh +++ b/bin/run-mangohud-gl-pkg.sh @@ -14,7 +14,7 @@ if [ "$#" -eq 0 ]; then fi # Execute the program under a clean environment -# pass through the overriden LD_PRELOAD environment variables +# pass through the overridden LD_PRELOAD environment variables LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" diff --git a/bin/run-mangohud-gl.sh b/bin/run-mangohud-gl.sh index 3cd7ebc2..6abb1f9a 100755 --- a/bin/run-mangohud-gl.sh +++ b/bin/run-mangohud-gl.sh @@ -15,7 +15,7 @@ if [ "$#" -eq 0 ]; then fi # Execute the program under a clean environment -# pass through the overriden LD_PRELOAD environment variables +# pass through the overridden LD_PRELOAD environment variables LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" LD_LIBRARY_PATH="${XDG_DATA_HOME}/MangoHud" diff --git a/build.sh b/build.sh index 5bca4d7c..db9bac55 100755 --- a/build.sh +++ b/build.sh @@ -78,7 +78,7 @@ dependencies() { if [[ $(pip3 show meson; echo $?) == 1 || $(pip3 show mako; echo $?) == 1 ]]; then $SU_CMD pip3 install 'meson>=0.54' mako fi - if [[ ! -f /usr/local/bin/glslangValidator ]]; then + if ! which glslangValidator >/dev/null; then wget https://github.com/KhronosGroup/glslang/releases/download/SDK-candidate-26-Jul-2020/glslang-master-linux-Release.zip unzip glslang-master-linux-Release.zip bin/glslangValidator $SU_CMD install -m755 bin/glslangValidator /usr/local/bin/ diff --git a/meson.build b/meson.build index adea4485..f9a43ed5 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project('MangoHud', cc = meson.get_compiler('c') cpp = meson.get_compiler('cpp') -prog_python = import('python').find_installation('python3') +prog_python = import('python').find_installation('python3', modules: ['mako']) null_dep = dependency('', required : false) mangohud_version = vcs_tag( diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index 9ef14f3f..8afc8470 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -407,7 +407,7 @@ parse_font_glyph_ranges(const char *str) static bool parse_help(const char *str) { - fprintf(stderr, "Layer params using VK_LAYER_MESA_OVERLAY_CONFIG=\n"); + fprintf(stderr, "Layer params using MANGOHUD_CONFIG=\n"); #define OVERLAY_PARAM_BOOL(name) \ fprintf(stderr, "\t%s=0|1\n", #name); #define OVERLAY_PARAM_CUSTOM(name) @@ -461,7 +461,7 @@ parse_string(const char *s, char *out_param, char *out_value) } if (*s && !i) { - fprintf(stderr, "mesa-overlay: syntax error: unexpected '%c' (%i) while " + fprintf(stderr, "MANGOHUD: syntax error: unexpected '%c' (%i) while " "parsing a string\n", *s, *s); fflush(stderr); } diff --git a/src/vulkan.cpp b/src/vulkan.cpp index 062382a6..209d1093 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -615,11 +615,11 @@ void init_system_info(){ const char* mangohud_recursion = getenv("MANGOHUD_RECURSION"); if (!mangohud_recursion) { setenv("MANGOHUD_RECURSION", "1", 1); - driver = exec("glxinfo -B | grep 'OpenGL version' | sed 's/^.*: //' | cut -d' ' --output-delimiter=$'\n' -f1- | grep -v '(' | grep -v ')' | tr '\n' ' ' | cut -c 1-"); + driver = exec("glxinfo -B | grep 'OpenGL version' | sed 's/^.*: //' | sed 's/([^()]*)//g' | tr -s ' '"); trim(driver); unsetenv("MANGOHUD_RECURSION"); } else { - driver = "MangoHud glxinfo recurssion detected"; + driver = "MangoHud glxinfo recursion detected"; } // Get WINE version