-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall-linux.sh
More file actions
executable file
·50 lines (43 loc) · 1.44 KB
/
Copy pathuninstall-linux.sh
File metadata and controls
executable file
·50 lines (43 loc) · 1.44 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
#!/usr/bin/env bash
# LookaRetro — reverts the Linux persistence applied by install-linux.sh.
# Does NOT remove the emulators or your ROMs.
#
# Usage:
# ./uninstall-linux.sh # dry-run
# ./uninstall-linux.sh --apply # actually revert (sudo for the logind part)
set -euo pipefail
APPLY=0
for arg in "$@"; do
case "$arg" in
--apply) APPLY=1 ;;
-h|--help) echo "Usage: $0 [--apply]"; exit 0 ;;
*) echo "Unknown option: $arg" >&2; exit 2 ;;
esac
done
revert() {
local desc="$1"; shift
if [[ "$APPLY" -eq 1 ]]; then
echo "==> $desc"
"$@"
else
echo "[dry-run] $desc -> $*"
fi
}
revert "Stopping and disabling the never-sleep inhibitor" \
systemctl --user disable --now lookaretro-inhibit.service 2>/dev/null || true
if [[ "$APPLY" -eq 1 ]]; then
rm -f "$HOME/.config/systemd/user/lookaretro-inhibit.service"
systemctl --user daemon-reload
rm -f "$HOME/.config/autostart/lookaretro-pegasus.desktop"
echo "==> Removed inhibit service + autostart entry"
else
echo "[dry-run] rm -f ~/.config/systemd/user/lookaretro-inhibit.service"
echo "[dry-run] rm -f ~/.config/autostart/lookaretro-pegasus.desktop"
fi
revert "Removing logind lid-close override" \
sudo rm -f /etc/systemd/logind.conf.d/lookaretro.conf
if [[ "$APPLY" -eq 1 ]]; then
sudo systemctl restart systemd-logind
fi
echo
echo "Done. Emulators, configs and ROMs were left untouched."