From df3dcc2706c461c0c806cced6fc7bc847640837b Mon Sep 17 00:00:00 2001 From: Gabe Date: Wed, 8 Jul 2026 23:33:02 +0000 Subject: [PATCH] Update Ricing/Windows-7-Theme/install-win7-theme.sh --- Ricing/Windows-7-Theme/install-win7-theme.sh | 34 +++++++------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/Ricing/Windows-7-Theme/install-win7-theme.sh b/Ricing/Windows-7-Theme/install-win7-theme.sh index cbb914f..52e5cf6 100644 --- a/Ricing/Windows-7-Theme/install-win7-theme.sh +++ b/Ricing/Windows-7-Theme/install-win7-theme.sh @@ -7,47 +7,37 @@ # ./install-win7-theme.sh set -euo pipefail - + BASE_URL="https://scripts.gabesville.com/Gabesville/Debian-Linux/raw/branch/main/Ricing/Windows-7-Theme" - + # filename -> destination dot-folder declare -A PACKAGES=( ["Windows-7-theme.zip"]="$HOME/.themes" ["Windows-7-icons.zip"]="$HOME/.icons" ) - + WORKDIR="$(mktemp -d)" trap 'rm -rf "$WORKDIR"' EXIT - + command -v unzip >/dev/null 2>&1 || { echo "unzip is required. Install it with: sudo apt install unzip" >&2; exit 1; } command -v curl >/dev/null 2>&1 || { echo "curl is required. Install it with: sudo apt install curl" >&2; exit 1; } - + for zipname in "${!PACKAGES[@]}"; do dest="${PACKAGES[$zipname]}" url="${BASE_URL}/${zipname}" extract_dir="${WORKDIR}/${zipname%.zip}" - + echo "==> Downloading ${zipname}..." curl -fL --progress-bar -o "${WORKDIR}/${zipname}" "$url" - + echo "==> Extracting ${zipname}..." mkdir -p "$extract_dir" unzip -q "${WORKDIR}/${zipname}" -d "$extract_dir" - + mkdir -p "$dest" - - # Figure out whether the zip already contains a single top-level folder - # (e.g. "Windows 7/") or a bunch of loose files/folders at the root. - # If it's a single folder, move that folder's *contents* straight into - # the dot-folder so we don't end up with an unnecessary nested dir. - mapfile -t top_level < <(find "$extract_dir" -mindepth 1 -maxdepth 1) - - if [[ ${#top_level[@]} -eq 1 && -d "${top_level[0]}" ]]; then - src="${top_level[0]}" - else - src="$extract_dir" - fi - + + src="$extract_dir" + echo "==> Installing into ${dest}..." for item in "$src"/*; do name="$(basename "$item")" @@ -58,7 +48,7 @@ for zipname in "${!PACKAGES[@]}"; do fi mv "$item" "$target" done - + echo "==> ${zipname} installed to ${dest}" echo done