-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·166 lines (136 loc) · 5.1 KB
/
install.sh
File metadata and controls
executable file
·166 lines (136 loc) · 5.1 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash
if [ "$1" == "help" ] || [ $# -ne 1 ];
then
echo "usage ./install.sh <Option>"
echo "Options Description"
echo "help : to see this print"
echo "vim : to install the vim settings only"
echo "update: to update the installed plugin"
echo "ycm : to install clang completer for ycm"
echo "git : to install the git settings only"
echo "bash : to install the bash settings only"
echo "conky : to install the conky settings only"
echo "packs : to install my personal packages"
echo "all : for the complete setup"
echo "i3 : to install the i3 setup"
echo "clean : to remove the complete setup"
fi
uservar=$(whoami)
packages="exuberant-ctags build-essential cmake python3-dev python2-dev ack-grep silversearcher-ag curl\
libncurses5-dev libgtk2.0-dev libatk1.0-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python2-dev \
python3-dev ruby-dev lua5.2 liblua5.2-dev libperl-dev \
apt install build-essential cmake vim-nox python3-dev\
apt install mono-complete golang nodejs openjdk-17-jdk openjdk-17-jre npm"
echo "Installation being carried out for user $uservar only"
if [ "$1" == "clean" ];
then
sudo rm ~/.vimrc
sudo rm ~/.ackrc
sudo rm -rvf ~/.vim
sudo rm ~/.gitconfig
sudo rm ~/.gitignore
sudo rm ~/.bashrc
rm ~/.conkyrc
sudo apt-get -y remove $packages
sudo apt-get -y autoremove
sudo apt-get -y autoclean
echo "When you are cleaning, why do you need me ? :'("
fi
if [ "$1" == "vim" ] || [ "$1" == "all" ] || [ $# -ne 1 ];
then
#TODO : Need to seperate depencies according to the distro.
echo "Installing all the dependencies "
sudo apt-get -y install $packages
#Building the Vim with Python 3.8
sudo apt remove vim vim-runtime gvim
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python3-config-dir=$(python3-config --configdir) \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local
make VIMRUNTIMEDIR=/usr/local/share/vim/vim91
sudo make install
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim 1
sudo update-alternatives --set editor /usr/local/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/local/bin/vim 1
sudo update-alternatives --set vi /usr/local/bin/vim
cd ..
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
#rm -rf fonts
mkdir -p ~/.vim/autoload
# Vim set up
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Replacing the .vimrc files "
sudo rm ~/.vimrc
ln -s ~/Linux-Set-up/rc_files/vimrc ~/.vimrc
echo "Installing all the plugins "
vim --cmd silent! +PlugInstall +qal
mkdir ~/.vim/undo
sudo chown $uservar ~/.vim/undo
echo "Putting in the .ackrc files "
sudo rm ~/.ackrc
ln -s ~/Linux-Set-up/rc_files/ackrc ~/.ackrc
echo "Copying Ultisnips"
sudo rm ~/.vim/my-snippets/c.snippets
sudo rm ~/.vim/my-snippets/cpp.snippets
mkdir ~/.vim/my-snippets
ln -s ~/Linux-Set-up/ultisnips/c.snippets ~/.vim/my-snippets/c.snippets
ln -s ~/Linux-Set-up/ultisnips/cpp.snippets ~/.vim/my-snippets/cpp.snippets
echo "Installing the C syntax file "
sudo rm ~/.vim/after/syntax/c.vim
mkdir -p ~/.vim/after/syntax/
sudo chown $uservar ~/.vim/after
sudo chown $uservar ~/.vim/after/syntax
ln -s ~/Linux-Set-up/syntax/c.vim ~/.vim/after/syntax/c.vim
echo "Setting up the colorschemes "
sudo rm ~/.vim/plugged/vim-colorschemes/colors/heroku-terminal.vim
sudo ln -s ~/Linux-Set-up/colors/heroku-terminal.vim ~/.vim/plugged/vim-colorschemes/colors/heroku-terminal.vim
sudo rm ~/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim
sudo ln -s ~/Linux-Set-up/colors/badwolf.vim ~/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim
echo "Resetting .viminfo to remove ownership of root"
sudo chown $uservar ~/.viminfo
fi
if [ "$1" == "update" ];
then
echo "Updating the installed plugin"
vim +PlugUpdate +qal
vim +PlugUpgrade +qal
fi
if [ "$1" == "git" ] || [ "$1" == "all" ];
then
echo "Adding the git config"
sudo rm ~/.gitconfig
ln -s ~/Linux-Set-up/rc_files/gitconfig ~/.gitconfig
sudo rm ~/.gitignore
ln -s ~/Linux-Set-up/rc_files/gitignore ~/.gitignore
fi
if [ "$1" == "bash" ] || [ "$1" == "all" ];
then
echo "Adding the bash config"
sudo rm ~/.bashrc
ln -s ~/Linux-Set-up/rc_files/bashrc ~/.bashrc
fi
if [ "$1" == "packs" ] || [ "$1" == "all" ];
then
sudo apt-get -y install numlockx konsole meld
fi
if [ "$1" == "i3" ];
then
./scripts/i3.sh
fi
echo "*************Linux Set Up is complete for $uservar.Have fun :)*****************"