-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·138 lines (105 loc) · 4.45 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
#!/bin/bash
# SCRIPT TO INSTALL MY IMPORTANT DOTFILES AND PLUGINS TO USER DIR
which sudo &>/dev/null
[ $? -eq 0 ] && echo "sudo found. Starting install.sh..." || (echo "sudo is not installed! Please install sudo." && read && exit 1)
which curl &>/dev/null
[ $? -eq 0 ] && echo "curl found. Starting install.sh..." || (echo "curl is not installed! Please install curl." && read && exit 1)
which git &>/dev/null
[ $? -eq 0 ] && echo "git found. Starting install.sh..." || (echo "git is not installed! Please install git." && read && exit 1)
#### APT ####
read -p "Do you want to install required packages via apt? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Update sources
sudo apt update
sudo apt upgrade
# Install Reqired packages
sudo apt install curl git build-essential cmake python3 python3-dev python3-pip neovim zsh
fi
#### ZSH ####
read -p "Do you want to install Zsh themes, scripts and plugins? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Installing Oh-my-zsh, please exit Zsh after install. Press Enter to continue..."
read
echo "Preparing.."
# Install Oh-My-Zsh
TEST_CURRENT_SHELL="zsh" # Prevent zsh launch
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Zsh-Autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
# Zsh-Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
# Zsh-Bullet Train theme
mkdir -p ~/.oh-my-zsh/custom/themes
curl https://raw.githubusercontent.com/caiogondim/bullet-train-oh-my-zsh-theme/master/bullet-train.zsh-theme -o ~/.oh-my-zsh/custom/themes/bullet-train.zsh-theme
# Copy over custom scripts
cp .oh-my-zsh/custom/greet.sh ~/.oh-my-zsh/custom/greet.sh
cp .oh-my-zsh/custom/keys.sh ~/.oh-my-zsh/custom/keys.sh
# Backup old .zshrc
mv ~/.zshrc ~/.zshrc_backup
# Copy over .zshrc
cp .zshrc ~/.zshrc
# Update for now (only required if using zsh)
source ~/.zshrc
echo "Zsh install done. You might want to check out Powerline fonts so your terminal doesn't look bugged: https://github.com/powerline/fonts"
fi
#### VIM PLUGINS ####
read -p "Do you want to install Vim configuration, plugins and themes? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Backup old .vimrc
mv ~/.vimrc ~/.vimrc_backup &>/dev/null
mv ~/.config/nvim ~/nvim_backup &>/dev/null
# Neovim softlink
ln -s ~/.vim ~/.config/nvim
rm ~/.config/nvim/init.vim
ln -s ~/.vimrc ~/.config/nvim/init.vim
# Copy over .vimrc
cp .vimrc ~/.config/nvim/init.vim
# Pathogen Vim
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# NERDTree
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
# YouCompleteMe
read -p "Do you want to install YouCompleteMe for Vim? (Requires Vim 8.0 with Python support, check with vim --version) [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
cd ~/.vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.py --clang-completer
fi
# SurroundMe
git clone git://github.com/tpope/vim-surround.git ~/.vim/bundle/vim-surround.git
# FugitiveVim (Git)
git clone https://github.com/tpope/vim-fugitive.git ~/.vim/bundle/vim-fugitive.git
# Vim Powerline Theme
git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline
# Vim Polyglot extended syntax highlighting
git clone https://github.com/sheerun/vim-polyglot ~/.vim/bundle/vim-polyglot
# One Dark/Light Color Scheme/Theme
git clone https://github.com/rakr/vim-one ~/.vim/bundle/vim-one
# Copy update script
cp update-plugins.sh ~/.vim/
fi
#### KDE ####
read -p "Do you want to install KDE, Konsole and KWin configurations and scripts? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# Copy over Konsole settings [KDE]
cp .local/share/konsole/* ~/.local/share/konsole/
cp .config/konsolerc ~/.config/konsolerc
# Copy over KWin settings [KDE]
cp .config/kwinrc ~/.config/kwinrc
# Copy over KDE Globals
cp .kde/share/config/kdeglobals ~/.kde/share/config/kdeglobals
fi
echo "Installation completed. Restart X for configs to load."