forked from OldJobobo/theme-hook-plugin-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
153 lines (128 loc) · 4.41 KB
/
Copy pathuninstall.sh
File metadata and controls
153 lines (128 loc) · 4.41 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/env bash
set -e
OMARCHY_PATH="${OMARCHY_PATH:-$HOME/.local/share/omarchy}"
restore_omarchy_branding_file() {
local source_file="$1"
local target_file="$2"
local label="$3"
if [[ -f "$source_file" ]]; then
mkdir -p "$(dirname "$target_file")"
cp -f "$source_file" "$target_file"
else
echo "Warning: Omarchy $label branding default not found: $source_file"
fi
}
restore_omarchy_branding_defaults() {
restore_omarchy_branding_file "$OMARCHY_PATH/icon.txt" "$HOME/.config/omarchy/branding/about.txt" "about"
restore_omarchy_branding_file "$OMARCHY_PATH/logo.txt" "$HOME/.config/omarchy/branding/screensaver.txt" "screensaver"
}
omarchy-show-logo
echo "Uninstalling thpm.."
rm -rf /tmp/theme-hook/
rm -f "$HOME/.local/bin/thpm"
rm -f "$HOME/.local/share/omarchy/bin/thpm"
rm -f "$HOME/.local/share/omarchy/bin/thctl"
rm -f "$HOME/.local/share/thpm/lib/theme-env.sh"
rm -rf "$HOME/.local/share/thpm/skills"
rmdir "$HOME/.local/share/thpm/lib" "$HOME/.local/share/thpm" 2>/dev/null || true
if [[ -f "$HOME/.config/omarchy/hooks/theme-set" ]] && grep -Eq 'Omarchy 3\.3\+ uses colors\.toml|Compatibility shim for older thpm installs' "$HOME/.config/omarchy/hooks/theme-set"; then
rm -f "$HOME/.config/omarchy/hooks/theme-set"
fi
bundled_plugins=(
00-fish.sh
00-fzf.sh
10-branding.sh
10-discord.sh
11-discord-system24.sh
10-gtk.sh
10-qt6ct.sh
10-spotify.sh
10-superfile.sh
10-tmux.sh
10-vicinae.sh
10-zellij.sh
15-typora.sh
20-nwg-dock-hyprland.sh
20-zed.sh
25-swaync.sh
26-foot-live-colors.sh
30-cursor.sh
30-vscode.sh
30-windsurf.sh
35-obsidian-terminal.sh
40-cava.sh
40-firefox.sh
40-hermes.sh
40-qutebrowser.sh
40-steam.sh
40-zen.sh
50-cliamp.sh
50-heroic.sh
)
for zen_hook in "$HOME"/.config/omarchy/hooks/theme-set.d/*-zen.sh "$HOME"/.config/omarchy/hooks/theme-set.d/*-zen.sh.sample; do
[[ -f "$zen_hook" ]] || continue
bash "$zen_hook" --cleanup > /dev/null 2>&1 || true
break
done
for firefox_hook in "$HOME"/.config/omarchy/hooks/theme-set.d/*-firefox.sh "$HOME"/.config/omarchy/hooks/theme-set.d/*-firefox.sh.sample; do
[[ -f "$firefox_hook" ]] || continue
bash "$firefox_hook" --cleanup > /dev/null 2>&1 || true
break
done
for plugin in "${bundled_plugins[@]}"; do
rm -f "$HOME/.config/omarchy/hooks/theme-set.d/$plugin"
rm -f "$HOME/.config/omarchy/hooks/theme-set.d/$plugin.sample"
done
rmdir "$HOME/.config/omarchy/hooks/theme-set.d" 2>/dev/null || true
restore_omarchy_branding_defaults
echo "Attempting to revert applied themes.."
# Remove Steam theme
if command -v python >/dev/null 2>&1 && [[ -d "$HOME/.local/share/steam-adwaita" ]]; then
(cd "$HOME/.local/share/steam-adwaita" && ./install.py --uninstall) > /dev/null 2>&1 || true
fi
# Remove Spotify theme
if command -v spicetify >/dev/null 2>&1; then
spicetify restore > /dev/null 2>&1 || true
fi
# Remove GTK theme
if command -v gsettings >/dev/null 2>&1; then
gsettings set org.gnome.desktop.interface gtk-theme Adwaita > /dev/null 2>&1 || true
fi
# Remove Qutebrowser theme
if command -v qutebrowser >/dev/null 2>&1; then
rm -rf "$HOME/.config/qutebrowser/omarchy"
config_file="$HOME/.config/qutebrowser/config.py"
if [[ -f "$config_file" ]]; then
sed -i '/import omarchy\.draw/d' "$config_file"
sed -i '/omarchy\.draw\.apply(c)/d' "$config_file"
fi
fi
# Remove Hermes theme
rm -f "$HOME/.config/Hermes/omarchy-theme.json"
# Remove Vicinae theme
if command -v vicinae >/dev/null 2>&1; then
vicinae theme set vicinae-dark > /dev/null 2>&1 || true
fi
# Remove Zellij theme generated by the bundled plugin.
if [[ -f "$HOME/.config/zellij/config.kdl" ]] && grep -Fq "thpm-zellij-theme-start" "$HOME/.config/zellij/config.kdl"; then
tmp_file="$(mktemp)"
awk '
/\/\/ thpm-zellij-theme-start/ {
in_managed = 1
next
}
/\/\/ thpm-zellij-theme-end/ {
in_managed = 0
next
}
!in_managed {
print
}
' "$HOME/.config/zellij/config.kdl" > "$tmp_file"
mv "$tmp_file" "$HOME/.config/zellij/config.kdl"
fi
if [[ -f "$HOME/.config/zellij/themes/current.kdl" ]] && grep -Fq "Generated by thpm zellij plugin" "$HOME/.config/zellij/themes/current.kdl"; then
rm -f "$HOME/.config/zellij/themes/current.kdl"
fi
echo "Uninstalled thpm!"
omarchy-show-done