-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuninstall.sh
More file actions
106 lines (86 loc) · 2.65 KB
/
uninstall.sh
File metadata and controls
106 lines (86 loc) · 2.65 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
#!/bin/sh
echo ""
echo "###################################"
echo "# dxf2gcode uninstall Script V3.1 #"
echo "# for Debian + Arch/CachyOS #"
echo "# by Daniel Luginbuehl #"
echo "# (C) 2026 #"
echo "###################################"
echo ""
# --- OS Detection ---------------------------------------------------------
if [ -f /etc/debian_version ]; then
OS="debian"
elif [ -f /etc/arch-release ]; then
OS="arch"
else
echo "Unsupported OS. Only Debian/Ubuntu and Arch/CachyOS are supported."
exit 1
fi
echo "Detected OS: $OS"
echo ""
# --- Ask about dependency removal ----------------------------------------
echo "Remove dependencies as well (y/n/q)?"
while true; do
read answer
case "$answer" in
[Yy]* )
REMOVE_DEPS=1
break ;;
[Nn]* )
REMOVE_DEPS=0
break ;;
[Qq]* )
exit ;;
esac
done
# --- Confirm uninstall ----------------------------------------------------
echo ""
echo "Uninstall dxf2gcode now (y/q)?"
while true; do
read answer
case "$answer" in
[Yy]* ) break ;;
[Qq]* ) exit ;;
esac
done
# --- Debian dependency removal -------------------------------------------
if [ "$OS" = "debian" ] && [ "$REMOVE_DEPS" = "1" ]; then
echo "Removing Debian dependencies..."
sudo apt-get purge -y dos2unix pyqt5-dev-tools qttools5-dev-tools poppler-utils pstoedit
fi
# --- Arch dependency removal ---------------------------------------------
if [ "$OS" = "arch" ] && [ "$REMOVE_DEPS" = "1" ]; then
echo "Removing Arch/CachyOS dependencies..."
sudo pacman -Rns --noconfirm \
dos2unix \
python-pyqt5 \
python-opengl \
qt5-tools \
poppler-utils \
pstoedit
fi
# --- Remove launcher + config --------------------------------------------
echo "Removing launcher and config..."
sudo rm -f /usr/local/bin/dxf2gcode
rm -rf ~/.config/dxf2gcode
rm -f "${HOME}/DXF2GCODE.ico"
sudo rm -f /usr/share/icons/DXF2GCODE.ico
rm -f ~/.local/share/icons/dxf2gcode.*
# --- Remove Python modules (dynamic) -------------------------------------
echo "Removing Python modules..."
# Detect installed Python versions
PYVERS=$(ls /usr/lib | grep -E '^python[0-9]+\.[0-9]+$' | sed 's/python//')
for ver in $PYVERS; do
for base in /usr/lib /usr/local/lib; do
for pkg in site-packages dist-packages; do
TARGET="$base/python$ver/$pkg/dxf2gcode"
if [ -d "$TARGET" ]; then
echo "Removing $TARGET"
sudo rm -rf "$TARGET"
fi
done
done
done
echo ""
echo "dxf2gcode has been removed."
echo ""