-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·53 lines (43 loc) · 2.06 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
#!/bin/bash
######################
# This script does two things:
# 1.backup your config file to ~/dotfiles_old.(if exist)
# 2.copy my config file for awesomewm & tmux & vim & urxvt & zsh to you.
######################
dir=~/dotfiles #dotfiles directory
olddir=~/dotfiles_old #old dotfiles backup directory
files="config/awesome tmux.conf vimrc Xresources zshrc" #list of files
# check if oh-my-zsh is installed
if [ ! -d ~/.oh-my-zsh ]; then
echo "You need install oh-my-zsh,see https://github.com/robbyrussell/oh-my-zsh"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
fi
# two awesome plugins for zsh
if [ ! -d ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions ]; then
echo "Installing zsh-autosuggestions......................."
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
fi
if [ ! -d ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ]; then
echo "Installing zsh-syntax-highlighting...................."
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
fi
# check if Vundle is installed
if [ ! -d ~/.vim/bundle ]; then
echo "You need install Vundle, see git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# change to the dotfiles directory
cd $dir
# backup old config files and copy my config files to you
echo -e "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddir
for file in $files; do
if [ -d ~/.$file -o -f ~/.$file ]; then
mv ~/.$file ~/dotfiles_old
fi
cp -r $file ~/.$file
done
xrdb ~/.Xresources #run this to load the resource file
echo -e "Installing vim plugins..."
vim +PluginInstall +qall #run this to install plugins for vim according to vimrc
echo -e "...........................\nAll done, restart awesomewm(Win + Ctrl + r) and open new terminal to see what happended"