-
Notifications
You must be signed in to change notification settings - Fork 2
/
uninstall.sh
executable file
·50 lines (41 loc) · 1.19 KB
/
uninstall.sh
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
#!/bin/bash
if [ "$1" == "--help" ]; then
echo "Usage: ./uninstall.sh [--help]"
echo " Remove all symlinks."
echo " --help Display this message"
exit
fi
function _unlink {
if [ "$#" != 1 ]; then
echo "Bad call to _unlink"
echo "Expected exactly 1 arguments, got $#"
echo "Exiting..."
exit
fi
[ ! -L "$1" ] && echo "Not a symlink; ignoring $1" && return 0
rm "$1" && echo "Removed symlink $1"
}
_unlink $HOME/.config/vim/base
_unlink $HOME/.config/vim/colors
_unlink $HOME/.config/vim/autoload
_unlink $HOME/.vimrc
_unlink $HOME/.vim
_unlink $HOME/.config/zsh
_unlink $HOME/.zshrc
_unlink $HOME/.config/pystartup
_unlink $HOME/.gitconfig
_unlink $HOME/.tmux.conf
_unlink $HOME/.local/bin/tmux-preswitch.sh
_unlink $HOME/.local/bin/rand-wall.sh
_unlink $HOME/.config/i3
_unlink $HOME/.config/dunst
_unlink $HOME/.config/Xresources.d
if [ -e $HOME/.Xresources ]; then
printf "Remove ~/.Xresources [y/N]: "
read rm_xres
[ "${rm_xres/Y/y}" == "y" ] && rm $HOME/.Xresources && echo "Removed $HOME/.Xresources"
else
echo "Path does not exist $HOME/.Xresources"
fi
echo "Left untouched: ~/.config/machine"
echo $'\n:: Done!'