-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeckremove
More file actions
executable file
·78 lines (66 loc) · 2.7 KB
/
Copy pathdeckremove
File metadata and controls
executable file
·78 lines (66 loc) · 2.7 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
#!/usr/bin/env bash
# deckremove — Uninstall DeckDroid completely
# Usage: deckremove
set -eo pipefail
DDROID_HOME="$HOME/.deckdroid"
R='\033[0;31m'; G='\033[0;32m'; Y='\033[1;33m'; CYAN='\033[0;36m'
B='\033[1m'; RESET='\033[0m'
echo -e "${B}${CYAN}"
echo "╔══════════════════════════════════════════════╗"
echo "║ DeckDroid — Uninstaller ║"
echo "╚══════════════════════════════════════════════╝${RESET}"
echo -e "${Y}This will remove ALL DeckDroid components:${RESET}"
echo -e " - ${CYAN}$DDROID_HOME${RESET} (config, tools, themes, logs, etc.)"
echo -e " - Symlinks in ${CYAN}\$PREFIX/bin/${RESET}"
echo -e " - ${CYAN}DeckDroid entries from ~/.zshrc${RESET}"
echo ""
read -r -p $'\e[1mAre you sure you want to continue? (y/n): \e[0m' confirm
case "$confirm" in
[yY]) ;;
*) echo -e "${Y}Cancelled.${RESET}"; exit 0 ;;
esac
# Remove symlinks
echo -e "\n${B}${CYAN}Removing symlinks...${RESET}"
tools=(
"deckbat" "deckping" "deckid" "deckclock" "deckwifi" "decklocate" "decksniff"
"decknote" "deckbrowse" "deckdisk" "decklog" "deckclean" "deckupdate" "decktheme"
"deckhelp" "deckmenu" "decksetup" "deckai" "tetris"
"ddeckconf" "ddeckprof" "deckdroid-doctor" "deckdroid-sync"
"deckdroid-web" "deckdroid-plugin" "deckdroid-vault"
"deckremove"
)
for tool in "${tools[@]}"; do
if [ -L "$PREFIX/bin/$tool" ]; then
rm -f "$PREFIX/bin/$tool"
echo -e " ${G}✓${RESET} Removed symlink: $tool"
fi
done
# Remove DeckDroid directory
if [ -d "$DDROID_HOME" ]; then
echo -e "\n${B}${CYAN}Removing $DDROID_HOME...${RESET}"
rm -rf "$DDROID_HOME"
echo -e " ${G}✓${RESET} DeckDroid directory removed"
else
echo -e "${Y} ~$(basename $DDROID_HOME) not found.${RESET}"
fi
# Clean .zshrc
echo -e "\n${B}${CYAN}Cleaning ~/.zshrc...${RESET}"
zshrc="$HOME/.zshrc"
if [ -f "$zshrc" ] && grep -q "DeckDroid" "$zshrc"; then
# Create backup
cp "$zshrc" "$zshrc.bak.$(date +%s)"
# Remove DeckDroid block
awk '
/^# ─── DeckDroid/ { skip=1 }
skip && /^# ─────────/ { skip=0; next }
!skip { print }
' "$zshrc" > "$zshrc.tmp"
mv "$zshrc.tmp" "$zshrc"
echo -e " ${G}✓${RESET} DeckDroid entries removed from .zshrc"
echo -e " ${Y}Backup saved as .zshrc.bak.*${RESET}"
else
echo -e " ${Y}No DeckDroid entries found in .zshrc${RESET}"
fi
echo -e "\n${B}${G}✓ DeckDroid has been completely uninstalled!${RESET}"
echo -e "${Y}Note:${RESET} Python/nodejs packages installed separately are not removed."
echo -e "Run: ${CYAN}zsh${RESET} to start a clean shell.\n"