-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
39 lines (32 loc) · 1.58 KB
/
Copy pathuninstall.sh
File metadata and controls
39 lines (32 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# random-library Spicetify uninstaller
# One-liner: bash <(curl -s "https://raw.githubusercontent.com/daviidpaark/random-library/main/uninstall.sh")
set -euo pipefail
if ! command -v spicetify &>/dev/null; then
echo "Error: spicetify not found in PATH." >&2
exit 1
fi
SPICE_PATH="$(spicetify -c | xargs dirname)"
CONFIG_FILE="$SPICE_PATH/config-xpui.ini"
APPS=("random-library" "random-albums")
# ── 1. Remove app folders ────────────────────────────────────────────────────
for app in "${APPS[@]}"; do
dest="$SPICE_PATH/CustomApps/$app"
if [[ -d "$dest" ]]; then
rm -rf "$dest"
echo "Removed $dest"
fi
done
# ── 2. Deregister from config-xpui.ini ──────────────────────────────────────
if [[ -f "$CONFIG_FILE" ]]; then
current="$(grep -E '^custom_apps\s*=' "$CONFIG_FILE" | sed 's/^custom_apps\s*=\s*//' | tr '|' '\n' | grep -v -E '^(random-library|random-albums)$' | paste -sd '|' -)"
sed -i.bak "s|^custom_apps\s*=.*|custom_apps = $current|" "$CONFIG_FILE"
rm -f "$CONFIG_FILE.bak"
echo "Deregistered apps from config-xpui.ini"
fi
# ── 3. Apply ──────────────────────────────────────────────────────────────────
echo ""
echo "Applying spicetify..."
spicetify apply
echo ""
echo "Done! Restart Spotify if it's already open."