-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·66 lines (57 loc) · 1.78 KB
/
install.sh
File metadata and controls
executable file
·66 lines (57 loc) · 1.78 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
#! /bin/bash
set -e
# DRY_RUN=true
function link {
if [[ ! ( (-f $1) || (-d $1 )) ]]; then
echo "File/Directory $1 does not exist!"
return 1
fi
if [[ -d $2 ]]; then
echo "Destination file $2 is an existing directory, skipping"
return 0
fi
if [[ -f $2 ]]; then
echo -n "Destination file $2 already exists, overwrite? y/[n]: "
read -n 1 overwrite
echo
if [[ ! (("$overwrite" = "y") || ("$overwrite" = "Y")) ]]; then
echo "Skipping $2"
return 0
else
rm "$2"
fi
fi
if [[ ! $DRY_RUN = true ]]; then
ln -s "$1" "$2"
else
echo "Linking $1 to $2"
fi
}
git submodule init
git submodule update
DOTFILES_DIR=$HOME/.dotfiles
DEJAVU_FONTS_DIR=$DOTFILES_DIR/fonts/DejaVuSansMono
declare -a DEJAVU_FONTS=("DejaVu Sans Mono for Powerline.ttf" "DejaVu Sans Mono Bold for Powerline.ttf")
install -dv $HOME/.fonts
install -dv $DOTFILES_DIR/.config
install -dv $HOME/.tmux/plugins
install -dv $HOME/.vim/autoload
cp $DOTFILES_DIR/.vim/autoload/plug.vim $HOME/.vim/autoload
link $DOTFILES_DIR/.config $HOME/.config
link $DOTFILES_DIR/.zshrc $HOME/.zshrc
link $DOTFILES_DIR/.Xresources $HOME/.Xresources
link $DOTFILES_DIR/.Xdefaults $HOME/.Xdefaults
link $DOTFILES_DIR/.Xresources.d $HOME/.Xresources.d
link $DOTFILES_DIR/.xinitrc $HOME/.xinitrc
link $DOTFILES_DIR/.vimrc $HOME/.vimrc
link $DOTFILES_DIR/.tmux.conf $HOME/.tmux.conf
link $DOTFILES_DIR/.tmux/plugins/tpm $HOME/.tmux/plugins/tpm
link $DOTFILES_DIR/.zshenv $HOME/.zshenv
link $DOTFILES_DIR/.emacs $HOME/.emacs
install -m 744 -d $HOME/.zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting $HOME/.zsh/zsh-syntax-highlighting
git clone https://github.com/sindresorhus/pure $HOME/.zsh/pure
for font in "${DEJAVU_FONTS[@]}"; do
link "$DEJAVU_FONTS_DIR/$font" "$HOME/.fonts/$font"
done
fc-cache -fv