diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just b/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just index 1f128ba096e..fdcc9825e81 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just @@ -21,3 +21,30 @@ fix-proton-hang: for PROG in "${PROTONCORE[@]}"; do killall -9 "$PROG" done + +# Reset the Steam folder back to a fresh install +fix-reset-steam: + #!/usr/bin/bash + source /usr/lib/ujust/ujust.sh + STEAMPATH="$HOME/.local/share/Steam" + # Get a list of the contents of steams top level directory except a list of folders/files we can skip to avoid losing data + STEAMFILES=$(ls ~/.local/share/Steam/ | grep -vP "(userdata|compatibilitytools\.d|config|controller_base|steamapps|music)") + echo "This script will ${b}remove${n} a bunch of files from $STEAMPATH and sign you out of steam!" + echo "However your games, music, saves, controller profiles and compatibilitytools/custom-proton will not be touched." + echo "To cancel and abort this operation press CTRL+C now, to continue press ENTER." + read i + killall -9 steam + sleep 1 + echo "Resetting Steam to a freshly installed state." + # Loop through each file and process it + for STEAMFILE in $STEAMFILES + do + if [ -d "$STEAMPATH/$STEAMFILE" ]; then + rm -rv "$STEAMPATH/$STEAMFILE" + elif [ -f "$STEAMPATH/$STEAMFILE" ]; then + rm -v "$STEAMPATH/$STEAMFILE" + fi + done + sleep 1 + bazzite-steam & + exit 0