-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
138 lines (116 loc) · 4.11 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
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
#!/bin/bash
set -e
echo_info() {
# print output in green
echo -e "\033[0;32m$*\033[0m"
}
echo_warn() {
# print output in yellow
echo -e "\033[0;33m$*\033[0m"
}
echo_error() {
# print output in red
echo -e "\033[0;31m$*\033[0m"
}
rm_existing() {
if [ -e "$1" ]; then
rm -rf "$1"
fi
}
mv_existing() {
if [ -e "$1" ]; then
echo_warn "Backing up existing file $1"
mv "$1" "$1"_old
fi
}
install_packages() {
for package in $@; do
echo_info Installing $package........................
sudo apt-get install -y $package
if [[ $? -ne 0 ]]; then
echo_error "##################################################"
echo_error "Error installing $package!"
echo_error "##################################################"
fi
done
}
install_neovim() {
echo_info "----------------------------------------------------------"
echo_info "Installing neovim..."
mkvirtualenv --python=/usr/bin/python3.5 neovim > /dev/null
pip install neovim > /dev/null
install_packages neovim
if [[ "$?" -ne "0" ]]; then
# Ubuntu installation
install_package software-properties-common
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt-get update > /dev/null
install_packages neovim
fi
ln -s $HOME/.files/vim $HOME/.config/nvim
}
install_termite() {
mkdir -p $HOME/software
# alternatively use script from https://github.com/Corwind/termite-install
cd $HOME/software
git clone https://github.com/thestinger/vte-ng.git
install_packages g++ libgtk-3-dev gtk-doc-tools gnutls-bin valac intltool \
libpcre2-dev libglib3.0-cil-dev libgnutls28-dev libgirepository1.0-dev \
libxml2-utils m4 gperf
cd vte-ng
./autogen.sh && make && sudo make install
echo /usr/local/lib/libvte-2.91.so | sudo tee --append /etc/ld.so.conf.d/vte.conf > /dev/null
sudo ldconfig
cd ..
git clone --recursive https://github.com/thestinger/termite.git
cd termite
make && sudo make install || echo "Could not build termite!"
sudo mkdir -p /lib/terminfo/x
sudo cp termite.terminfo /lib/terminfo/x/xterm-termite
tic -x termite.terminfo
mkdir -p $HOME/.config/termite
ln -s $HOME/.files/termite_config $HOME/.config/termite/config
}
install_powerline_font() {
mkdir -p $HOME/software
# https://powerline.readthedocs.io/en/latest/installation/linux.html#fonts-installation
# https://github.com/powerline/powerline/issues/1589
cd $HOME/software
git clone https://github.com/powerline/fonts
mkdir -p ~/.local/share/fonts
cp fonts/DejaVuSansMono/"DejaVu Sans Mono for Powerline.ttf" ~/.local/share/fonts
fc-cache -v -f ~/.local/share/fonts
# not consistent across distros, hence set links
ln -s ~/.local/share/fonts ~/.fonts
ln -s ~/.config/fontconfig/conf.d ~/.fonts.conf.d
}
install_texlive() {
echo_info "----------------------------------------------------------"
echo_info "Installing texlive..."
# https://www.tug.org/texlive/doc/install-tl.html
if [[ ! -f $HOME/.files/texlive.profile ]]; then
echo_error "$HOME/.files/texlive.profile not found!"
exit
fi
mkdir -p ~/Downloads
cd ~/Downloads
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar xf install-tl-unx.tar.gz
cd install-tl-$(date +%Y%m%d)
sudo ./install-tl -profile ~/.files/texlive.profile
cd ..
rm -rf install-tl-*
# create symlinks to tex binaries in /usr/local/bin
sudo /usr/local/texlive/$(date +%Y)/bin/x86_64-linux/./tlmgr path add
install_packages latexmk xzdec
}
install_qtcreator() {
echo_info "----------------------------------------------------------"
install_package libgl1-mesa-dev
echo_info "Installing qtcreator..."
cd $HOME/Downloads
wget -q http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run > /dev/null
chmod 755 qt-unified-linux-x64-online.run
sudo ./qt-unified-linux-x64-online.run
sudo ln -s /opt/Qt/5.9.1/gcc_64/include /usr/include/qt
}