-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·134 lines (113 loc) · 4.66 KB
/
uninstall.sh
File metadata and controls
executable file
·134 lines (113 loc) · 4.66 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
#!/usr/bin/env bash
# Archer Compatibility Suite - Unified Uninstaller v2.0
# Supports manifest-based selective uninstall with legacy fallback
# Note: -e intentionally omitted so uninstall continues if individual steps fail
set -uo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Source utilities
source "$SCRIPT_DIR/lib/utils.sh"
source "$SCRIPT_DIR/lib/detect.sh"
source "$SCRIPT_DIR/lib/manifest.sh"
# Parse arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run) DRY_RUN=1 ;;
--no-confirm) NO_CONFIRM=1 ;;
--help|-h)
echo "Archer Compatibility Suite - Uninstaller v${INSTALLER_VERSION}"
echo ""
echo "Usage: ./uninstall.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --dry-run Show what would be removed without making changes"
echo " --no-confirm Skip confirmation prompts"
echo " --help, -h Show this help message"
exit 0
;;
*) warn "Unknown option: $1" ;;
esac
shift
done
if [[ "$DRY_RUN" -eq 1 ]]; then
log "DRY RUN mode enabled. No changes will be made."
fi
section "Archer Compatibility Suite - Uninstaller"
if has_manifest; then
log "Install manifest found. Performing targeted uninstall."
echo ""
INSTALLED_MODS=$(read_manifest_modules)
log "Installed modules: $INSTALLED_MODS"
echo ""
for mod in $INSTALLED_MODS; do
local_mod_file="$SCRIPT_DIR/modules/${mod}.sh"
if [[ -f "$local_mod_file" ]]; then
log "Uninstalling: $mod"
source "$local_mod_file"
module_uninstall
success "Removed: $mod"
else
warn "Module file not found: $local_mod_file (skipping)"
fi
echo ""
done
# Remove manifest
run rm -f "$MANIFEST_FILE"
log "Install manifest removed."
else
warn "No install manifest found. Performing legacy uninstall."
warn "This will attempt to remove all known components."
echo ""
# Legacy uninstall: same as original v1 behavior
# 1. Disable Services (legacy DAMX daemon cleanup)
log "Checking for legacy DAMX daemon..."
run systemctl --user disable --now damx-daemon.service 2>/dev/null || true
run rm -f "$HOME/.config/systemd/user/damx-daemon.service"
run systemctl --user daemon-reload
# 2. Remove Driver (DKMS)
log "Removing Linuwu-Sense DKMS module..."
run_sudo dkms remove -m linuwu-sense -v 1.0 --all 2>/dev/null || true
run_sudo rm -rf "/usr/src/linuwu-sense-1.0"
# 3. Remove Blacklist
log "Restoring acer_wmi (removing blacklist)..."
run_sudo rm -f /etc/modprobe.d/blacklist-acer-wmi.conf
# 4. Remove other possible configs from v2 modules
run_sudo rm -f /etc/modprobe.d/touchpad-amd-fix.conf
run_sudo rm -f /etc/modprobe.d/acer-audio-amd.conf
run_sudo rm -f /etc/modprobe.d/acer-thermal-profiles.conf
run_sudo rm -f /etc/udev/rules.d/99-acer-battery-health.rules
run_sudo rm -f /etc/tlp.d/01-acer-optimize.conf
# Remove touchpad service if present
if [[ -f /etc/systemd/system/touchpad-fix.service ]]; then
run_sudo systemctl disable touchpad-fix.service 2>/dev/null || true
run_sudo rm -f /etc/systemd/system/touchpad-fix.service
run_sudo systemctl daemon-reload
fi
# Remove acer-wmi-battery DKMS if present
run_sudo dkms remove -m acer-wmi-battery -v 0.1.0 --all 2>/dev/null || true
run_sudo rm -rf "/usr/src/acer-wmi-battery-0.1.0"
# 5. Clean application files
log "Removing application data..."
run rm -rf "$HOME/.local/share/damx"
run rm -rf "$HOME/.local/share/archer"
# 6. Remove Archer GUI if installed
if [[ -d /opt/archer ]]; then
log "Removing Archer GUI..."
run_sudo systemctl disable --now archer-daemon.service 2>/dev/null || true
run_sudo rm -f /etc/systemd/system/archer-daemon.service
run_sudo systemctl daemon-reload
run_sudo rm -rf /opt/archer
run_sudo rm -f /usr/share/applications/io.github.archer.desktop
run_sudo rm -f /usr/share/icons/hicolor/scalable/apps/io.github.archer.svg
run_sudo rm -f /usr/local/bin/archer-gui
run_sudo rm -rf /etc/archer
fi
# 7. Remove enhancement configs if present
run_sudo rm -f /etc/gamemode.d/archer.ini
run_sudo rm -f /etc/pipewire/filter-chain.conf.d/archer-noise-suppress.conf
run_sudo rm -f /etc/modprobe.d/archer-v4l2loopback.conf
run_sudo systemctl disable --now fwupd.service 2>/dev/null || true
fi
section "Cleanup Complete"
success "All installed components have been removed."
echo ""
warn "You may need to reboot to fully restore default driver behavior."