You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
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"
|
|
}
|
|
|
|
uninstall() {
|
|
[ "$UID" -eq 0 ] || exec sudo bash "$0" uninstall
|
|
rm -rfv "/usr/lib/mangohud"
|
|
rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"
|
|
rm -fv "/usr/share/vulkan/implicit_layer.d/MangoHud.x86_64.json"
|
|
rm -frv "/usr/share/doc/mangohud"
|
|
rm -fv "/usr/bin/mangohud"
|
|
rm -fv "/usr/bin/mangohud.x86"
|
|
}
|
|
|
|
for a in $@; do
|
|
case $a in
|
|
"install") install;;
|
|
"uninstall") uninstall;;
|
|
*)
|
|
echo "Unrecognized command argument: $a"
|
|
echo 'Accepted arguments: "install", "uninstall".'
|
|
esac
|
|
done |