-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
65 lines (60 loc) · 1.74 KB
/
setup.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
install_command="pacman -S"
while getopts "d:" opt;do
case ${opt} in
d)
case ${OPTARG} in
arch)
install_command="pacman -S"
;;
gentoo)
install_command="emerge -v"
;;
*)
echo "Unrecognized distro. Falling back to arch"
install_command="pacman -S"
;;
esac
echo "Using ${OPTARG}"
;;
*)
echo "Unexpected option"
;;
esac
done
[[ $(command -v zsh ) ]] && printf "zsh already installed!\n" || sudo $($install_command zsh)
if ! [[ -d ~/zsh-git-prompt ]];then
printf "Repository zsh-git-prompt is required. Proceed? [Enter to continue, Ctrl-c to exit]"
read
pushd .
cd ~
git clone https://github.com/olivierverdier/zsh-git-prompt.git
popd
else
printf "zsh-git-prompt requirement already installed\n"
fi
if [[ -f ~/.zshrc ]];then
printf "$HOME/.zshrc already exists. Do you which to replace it by ELIMINATING the existing? [Enter to continue, Ctrl-c to exit]"
read
cp ~/.zshrc ~/.zshrc.bak
fi
ln -sf $(pwd)/.zshrc ~/.zshrc
if [[ -f ~/.vimrc ]];then
printf "$HOME/.vimrc already exists. Do you which to replace it by ELIMINATING the existing? [Enter to continue, Ctrl-c to exit]"
read
cp ~/.vimrc ~/.vimrc.bak
fi
ln -sf $(pwd)/.vimrc ~/.vimrc
if [[ -f ~/.Xresources ]];then
printf "$HOME/.Xresources already exists. Do you which to replace it by ELIMINATING the existing? [Enter to continue, Ctrl-c to exit]"
read
cp ~/.Xresources ~/.Xresources.bak
fi
ln -sf $(pwd)/.Xresources ~/.Xresources
if [[ -f ~/.screenrc ]];then
printf "$HOME/.screenrc already exists. Do you which to replace it by ELIMINATING the existing? [Enter to continue, Ctrl-c to exit]"
read
cp ~/.screenrc ~/.screenrc.bak
fi
ln -sf $(pwd)/.screenrc ~/.screenrc
printf "Everything is now ready!\n"