chore(cli): added --mangohud-preview

parent 52bdd46d
......@@ -1884,6 +1884,30 @@ pw_mangohud_check () {
return 0
}
pw_mangohud_preview () {
local preview_config="${1:-}"
if [[ -n "$preview_config" ]] ; then
export MANGOHUD_CONFIG="$preview_config"
print_info "MangoHud preview inline config in use: $MANGOHUD_CONFIG"
fi
PW_MANGOHUD="1"
PW_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PW_PLUGINS_PATH}/portable/lib/lib64:${PW_PLUGINS_PATH}/portable/lib/lib32"
PW_VK_LAYER_PATH="${PW_PLUGINS_PATH}/portable/share/vulkan/implicit_layer.d"
export PW_MANGOHUD
pw_mangohud_check
env \
$PW_ADD_VAR_SLR \
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
VK_ADD_IMPLICIT_LAYER_PATH="${PW_VK_LAYER_PATH}" \
VK_ADD_LAYER_PATH="${PW_VK_LAYER_PATH}" \
VK_INSTANCE_LAYERS="${PW_VK_INSTANCE_LAYERS}" \
"${PW_PLUGINS_PATH}/portable/bin/vkcube"
}
pw_lsfg_vk_check () {
if [[ "${PW_USE_LS_FRAME_GEN}" == "1" ]] ; then
local lsfg_vk_path="$PW_PLUGINS_PATH/fake_dlss/lsfg-vk-$PW_LSFG_VK_VER"
......@@ -6149,17 +6173,7 @@ gui_mangohud () {
edit_db_from_gui MANGOHUD_CONFIG PW_MANGOHUD FPS_LIMIT
if [[ "${YAD_MANGOHUD_STATUS}" == "184" ]] ; then
PW_MANGOHUD="1"
pw_init_runtime
pw_mangohud_check
${pw_runtime} \
$PW_ADD_VAR_SLR \
LD_LIBRARY_PATH="${PW_LD_LIBRARY_PATH}" \
LD_PRELOAD="${PW_LD_PRELOAD}" \
VK_ADD_IMPLICIT_LAYER_PATH="${PW_VK_LAYER_PATH}" \
VK_ADD_LAYER_PATH="${PW_VK_LAYER_PATH}" \
VK_INSTANCE_LAYERS="${PW_VK_INSTANCE_LAYERS}" \
"${PW_PLUGINS_PATH}/portable/bin/vkcube"
pw_mangohud_preview "${MANGOHUD_CONFIG}"
gui_mangohud
fi
......
......@@ -445,6 +445,7 @@ case "$1" in
--winereg ${translations[Open wine registry editor, requires WINE version and prefix name]}
--wine_uninstaller ${translations[Open wine uninstaller, requires WINE version and prefix name]}
--clear_pfx ${translations[Clear specified prefix, requires WINE version and prefix name]}
--mangohud-preview ${translations[Starts MangoHud preview in vkcube (optional argument: inline MangoHud config)]}
--initial ${translations[Initial setup command]}
--autoinstall ${translations[--autoinstall and the name of what needs to be installed is given in the list below:]}
......@@ -459,6 +460,7 @@ ${translations[Usage examples:]}
portproton cli --backup-prefix DEFAULT /path/to/backup/directory
portproton cli --restore-prefix /path/to/backup/file.ppack
portproton cli --winecfg WINE_LG DEFAULT
portproton cli --mangohud-preview "fps,frametime,cpu_temp,gpu_temp"
portproton cli --autoinstall [script_name_from_pw_autoinstall]
"
}
......@@ -624,6 +626,10 @@ ${translations[Usage examples:]}
pw_clear_pfx
exit $?
;;
--mangohud-preview)
pw_mangohud_preview "${2:-}"
exit $?
;;
--initial)
exit 0
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment