aboutsummaryrefslogtreecommitdiffstats
path: root/uninstall.sh
blob: 9a12a4e4c7a58ad824043e3fe8bb17cfae3e2916 (plain) (blame)
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
#!/usr/bin/env bash

# set -e

echo "🌤️  panahone weather applet uninstaller"
echo "========================================"
echo ""

read -p "are you sure you want to uninstall panahone? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "uninstallation cancelled."
    exit 0
fi

# rm symbolic link
if [ -L ~/.local/bin/panahone ]; then
    rm ~/.local/bin/panahone
    echo "✅ removed symbolic link from ~/.local/bin"
fi

# rm .desktop file
if [ -f ~/.local/share/applications/panahone.desktop ]; then
    rm ~/.local/share/applications/panahone.desktop
    echo "✅ removed desktop entry"
fi

# rm xdg autostart shenanigans
if [ -f ~/.config/autostart/panahone.desktop ]; then
    rm ~/.config/autostart/panahone.desktop
    echo "✅ removed autostart entry"
fi

echo ""
read -p "do you want to remove configuration and cache files? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
    if [ -d ~/.config/panahone ]; then
        rm -rf ~/.config/panahone
        echo "✅ removed configuration directory"
    fi

    if [ -d ~/.cache/panahone ]; then
        rm -rf ~/.cache/panahone
        echo "✅ removed cache directory"
    fi
fi

echo ""
echo "🎉 panahone has been uninstalled."
echo "you can manually remove the source directory if desired."