forked from klaxalk/linux-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·255 lines (190 loc) · 6.86 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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/bin/bash
set -e
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?"' ERR
# get the path to this script
MY_PATH=`dirname "$0"`
MY_PATH=`( cd "$MY_PATH" && pwd )`
# define paths
APPCONFIG_PATH=$MY_PATH/appconfig
# install packages
sudo apt-get -y update
subinstall_params=""
unattended=0
docker=false
for param in "$@"
do
echo $param
if [ $param="--unattended" ]; then
echo "installing in unattended mode"
unattended=1
subinstall_params="--unattended"
fi
if [ $param="--docker" ]; then
echo "installing in docker mode"
docker=true
fi
done
cd $MY_PATH
$docker && git submodule update --init --recursive --recommend-shallow
! $docker && git submodule update --init --recursive
var1="18.04"
var2=`lsb_release -r | awk '{ print $2 }'`
[ "$var2" = "$var1" ] && export BEAVER=1
arch=`uname -i`
# essentials
sudo apt-get -y install git tig cmake cmake-curses-gui build-essential automake autoconf autogen libncurses5-dev libc++-dev pkg-config libtool net-tools openssh-server nmap
# python
sudo apt-get -y install python2.7-dev python3-dev python-setuptools python3-setuptools python3-pip
if [ -n "$BEAVER" ]; then
sudo apt-get -y install python-git
sudo ln -sf /bin/python2.7 /bin/python
else
sudo apt-get -y install python3-git
fi
# other stuff
sudo apt-get -y install ruby sl indicator-multiload figlet toilet gem tree exuberant-ctags xclip xsel exfat-fuse exfat-utils blueman autossh jq xvfb gparted espeak ncdu pavucontrol
if [ "$unattended" == "0" ]
then
if [ "$?" != "0" ]; then echo "Press Enter to continues.." && read; fi
fi
# install TMUX
bash $APPCONFIG_PATH/tmux/install.sh $subinstall_params
# setup RANGER
bash $APPCONFIG_PATH/ranger/install.sh $subinstall_params
# install VIM
bash $APPCONFIG_PATH/vim/install.sh $subinstall_params
# install HTOP-VIM
bash $APPCONFIG_PATH/htop-vim/install.sh $subinstall_params
# install URXVT
! $docker && bash $APPCONFIG_PATH/urxvt/install.sh $subinstall_params
# install FONTS POWERLINE
! $docker && bash $APPCONFIG_PATH/fonts-powerline/install.sh $subinstall_params
# install NVIM
# bash $APPCONFIG_PATH/nvim/install.sh $subinstall_params
# install ZSH with ATHAME
! $docker && bash $APPCONFIG_PATH/zsh/install.sh $subinstall_params
# install I3
! $docker && bash $APPCONFIG_PATH/i3/install.sh $subinstall_params
# install LATEX and PDF support
! $docker && bash $APPCONFIG_PATH/latex/install.sh $subinstall_params
# install PDFPC
! $docker && bash $APPCONFIG_PATH/pdfpc/install.sh $subinstall_params
# install MULTIMEDIA support
! $docker && bash $APPCONFIG_PATH/multimedia/install.sh $subinstall_params
# install PANDOC
if [ "$arch" != "aarch64" ]; then
! $docker && bash $APPCONFIG_PATH/pandoc/install.sh $subinstall_params
fi
# install SHUTTER
if [ "$arch" != "aarch64" ]; then
! $docker && bash $APPCONFIG_PATH/shutter/install.sh $subinstall_params
fi
# install ZATHURA
! $docker && bash $APPCONFIG_PATH/zathura/install.sh $subinstall_params
# install VIMIV
! $docker && bash $APPCONFIG_PATH/vimiv/install.sh $subinstall_params
# install SILVER SEARCHER (ag)
bash $APPCONFIG_PATH/silver_searcher/install.sh $subinstall_params
# setup modified keyboard rules
! $docker && bash $APPCONFIG_PATH/keyboard/install.sh $subinstall_params
# setup fuzzyfinder
bash $APPCONFIG_PATH/fzf/install.sh $subinstall_params
# install PLAYERCTL
if [ "$arch" != "aarch64" ]; then
! $docker && bash $APPCONFIG_PATH/playerctl/install.sh $subinstall_params
fi
# install PAPIS
! $docker && bash $APPCONFIG_PATH/papis/install.sh $subinstall_params
# install VIM-STREAM
bash $APPCONFIG_PATH/vim-stream/install.sh $subinstall_params
# install GRUB CUSTOMIZER
if [ "$arch" != "aarch64" ]; then
! $docker && bash $APPCONFIG_PATH/grub-customizer/install.sh $subinstall_params
fi
# install TMUXINATOR
bash $APPCONFIG_PATH/tmuxinator/install.sh $subinstall_params
# the docker setup ends here
if $docker; then
exit 0
fi
#############################################
# remove the interactivity check from bashrc
#############################################
if [ -x "$(whereis nvim | awk '{print $2}')" ]; then
VIM_BIN="$(whereis nvim | awk '{print $2}')"
HEADLESS="--headless"
elif [ -x "$(whereis vim | awk '{print $2}')" ]; then
VIM_BIN="$(whereis vim | awk '{print $2}')"
HEADLESS=""
fi
# this caused some problems once, but where?
$VIM_BIN $HEADLESS -E -s -c "%g/running interactively/norm dap" -c "wqa" -- ~/.bashrc
#############################################
# adding GIT_PATH variable to .bashrc
#############################################
# add variable for path to the git repository
num=`cat ~/.bashrc | grep "GIT_PATH" | wc -l`
if [ "$num" -lt "1" ]; then
TEMP=`( cd "$MY_PATH/../" && pwd )`
echo "Adding GIT_PATH variable to .bashrc"
# set bashrc
echo "
# path to the git root
export GIT_PATH=$TEMP" >> ~/.bashrc
fi
##################################################
# install inputs libraries when they are missing
##################################################
sudo apt-get -y install xserver-xorg-input-all
#############################################
# Disable automatic update over apt
#############################################
sudo systemctl disable apt-daily.service
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily-upgrade.timer
sudo systemctl disable apt-daily-upgrade.service
#############################################
# link the scripts folder
#############################################
if [ ! -e ~/.scripts ]; then
ln -sf $MY_PATH/scripts ~/.scripts
fi
#############################################
# add PROFILES variables
#############################################
num=`cat ~/.bashrc | grep "PROFILES" | wc -l`
if [ "$num" -lt "1" ]; then
echo "Adding epigen rules to .bashrc"
echo '
# list (space-separated) of profile names for customizing configs
export PROFILES="COLORSCHEME_DARK"' >> ~/.bashrc
fi
#############################################
# fix touchpad touch-clicking
#############################################
if [ ! -e /etc/X11/xorg.conf.d/90-touchpad.conf ]; then
$MY_PATH/scripts/fix_touchpad_click.sh
fi
#############################################
# add sourcing of dotbashrd to .bashrc
#############################################
num=`cat ~/.bashrc | grep "dotbashrc" | wc -l`
if [ "$num" -lt "1" ]; then
echo "Adding source to .bashrc"
# set bashrc
echo "
# sourcing Tomas's linux setup
source $APPCONFIG_PATH/bash/dotbashrc" >> ~/.bashrc
fi
#############################################
# link dotclang-tidy to ~/.clang-tidy
# (enable linting for YCM)
#############################################
ln -sf "$APPCONFIG_PATH/clangd/dotclang-tidy" ~/.clang-tidy
# deploy configs by Profile manager
./deploy_configs.sh
# finally source the correct rc file
toilet All Done
# say some tips to the new user
echo "Hurray, the 'Linux Setup' should be ready, try opening a new terminal."