diff --git a/bin/mangohud-setup.sh b/bin/mangohud-setup.sh index 2704c2d2..aa492cc8 100755 --- a/bin/mangohud-setup.sh +++ b/bin/mangohud-setup.sh @@ -1,6 +1,19 @@ +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +MANGOHUD_CONFIG_DIR="$XDG_CONFIG_HOME/MangoHud" + +config() { + mkdir -p "${MANGOHUD_CONFIG_DIR}" + echo You can use the example configuration file from + echo /usr/share/doc/mangohud/MangoHud.conf.example + echo as a starting point by copying it to + echo ${MANGOHUD_CONFIG_DIR}/MangoHud.conf + echo +} + install() { rm -rf "$HOME/.local/share/MangoHud/" rm -f "$HOME/.local/share/vulkan/implicit_layer.d/"{mangohud32.json,mangohud64.json} + [ "$UID" -eq 0 ] || config [ "$UID" -eq 0 ] || exec sudo bash "$0" install tar -C / --no-overwrite-dir -xvhf MangoHud-package.tar echo "MangoHud Installed" diff --git a/build.sh b/build.sh index ddbd12f8..e77bc9be 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,7 @@ OS_RELEASE_FILES=("/etc/os-release" "/usr/lib/os-release") XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" DATA_DIR="$XDG_DATA_HOME/MangoHud" +CONFIG_DIR="$XDG_CONFIG_HOME/MangoHud" LAYER="build/release/usr/share/vulkan/implicit_layer.d/mangohud.json" INSTALL_DIR="build/package/" IMPLICIT_LAYER_DIR="$XDG_DATA_HOME/vulkan/implicit_layer.d" @@ -155,6 +156,7 @@ install() { echo No package found. Run \"$0 package\". exit 1 fi + [ "$UID" -eq 0 ] || mkdir -pv "${CONFIG_DIR}" [ "$UID" -eq 0 ] || exec sudo bash "$0" install tar -C / --no-overwrite-dir -xvhf build/MangoHud-package.tar echo "MangoHud Installed"