-
Notifications
You must be signed in to change notification settings - Fork 46
/
uninstall
37 lines (29 loc) · 914 Bytes
/
uninstall
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
#!/bin/bash
set -e
function trysudo {
$@ 2> /dev/null || sudo $@
}
function uninstall {
TARGET="${1?missing uninstall parameter}"
if [[ -f "$TARGET" ]]; then
trysudo rm -f "$TARGET"
echo "Removed: $TARGET"
elif [[ ! -z "$TARGET" ]]; then
echo "Not found: $TARGET"
fi
}
# stop program first if it is still running
comfortable-swipe stop 2> /dev/null || true
# uninstall binaries
uninstall "$(which comfortable-swipe || echo /usr/share/bin/comfortable-swipe)"
uninstall "$(which comfortable-swipe-buffer || echo /usr/share/bin/comfortable-swipe-buffer)"
# uninstall desktop file
uninstall "$HOME/.config/autostart/comfortable-swipe.desktop"
# tell user we are keeping configuration file
CONF_TARGET="$HOME/.config/comfortable-swipe.conf"
if [ -f "$CONF_TARGET" ]; then
echo "Keeping your configuration file: $CONF_TARGET"
fi
cat <<EOF
Successfully uninstalled comfortable-swipe
EOF