-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·41 lines (35 loc) · 1.17 KB
/
install.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
#!/bin/bash
DIR_REL=$(dirname $0)
DIR=$(readlink -f $DIR_REL)
# Source bashrc configurations
if ! grep -q "conf/bashrc" ~/.bashrc; then
src_txt="# conf definition\n
if [ -d $DIR/bashrc ]; then\n
\tfor f in $DIR/bashrc/*; do\n
\t\t. \$f\n
\tdone\n
fi\n"
echo -e $src_txt >> ~/.bashrc
fi
# Config tilix
dconf load /com/gexperts/Tilix/ < $DIR/tilix/tilix.dconf
if ! grep -q "TILIX_ID" ~/.bashrc && [ -f /etc/profile.d/vte-2.91.sh ]; then
src_txt="# Conf tilix\n
if [ \$TILIX_ID ] || [ \$VTE_VERSION ]; then\n
\tsource /etc/profile.d/vte-2.91.sh\n
fi\n"
echo -e $src_txt >> ~/.bashrc
fi
# Source git, svn and vim configurations
if [ -f ~/.gitconfig ] || [ -f ~/.subversion/config ] || [ -f ~/.vimrc ]; then
while [ "$ANSWER" != "y" ] && [ "$ANSWER" != "n" ]; do
echo -n "File ~/.gitconfig or ~/.subversion/config or ~/.vimrc already exist, do you want to remove it?(y/n)"
read -n 1 ANSWER
done
if [ "$ANSWER" != "y" ]; then
exit 1
fi
fi
ln -sf $DIR/git/gitconfig ~/.gitconfig
ln -sf $DIR/svn/svnconfig ~/.subversion/config
ln -sf $DIR/vim/vimrc ~/.vimrc