-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-sh
executable file
·74 lines (62 loc) · 2.04 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
#!/bin/bash
srcdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )"
if [[ -d "$1" ]] ; then
dstdir="$1"
shift 1
else
dstdir="$HOME"
fi
dotfiles=(profile bash_logout
tmux.conf screenrc gitconfig cvsignore
ctags.d sqliterc psqlrc condarc)
dotfiles_extra=(gvimrc vim/bundle vim/python3 vim/syntax
pylintrc xsettingsd gtkrc-2.0 i3/config.global
config/gtk-3.0/settings.ini
config/dunst/dunstrc
config/zathura/zathurarc
config/clipit/clipitrc
config/termite/config
config/alacritty/alacritty.yml
config/fish/functions
config/rofi/config.rasi)
cd "$dstdir"
[[ -d .vim ]] || mkdir .vim
[[ -d .vim/tmp ]] || mkdir .vim/tmp
[[ -d .vim/tmp/backup ]] || mkdir .vim/tmp/backup
[[ -d .vim/tmp/undo ]] || mkdir .vim/tmp/undo
[[ -d .vim/tmp/swap ]] || mkdir .vim/tmp/swap
[[ -d .config/dunst ]] || mkdir -p .config/dunst
[[ -d .config/zathura ]] || mkdir -p .config/zathura
[[ -d .config/clipit ]] || mkdir -p .config/clipit
[[ -d .config/fish ]] || mkdir -p .config/fish
[[ -d .config/gtk-3.0 ]] || mkdir -p .config/gtk-3.0
[[ -d .config/termite ]] || mkdir -p .config/termite
[[ -d .config/alacritty ]] || mkdir -p .config/alacritty
[[ -d .config/rofi ]] || mkdir -p .config/rofi
# Dont overwrite bashrc, vimrc, config.fish
if [[ ! -r .bashrc ]] ; then
\cp -i "$srcdir/bashrc" ".bashrc"
fi
if [[ ! -r .vimrc ]] ; then
\cp -i "$srcdir/vimrc" ".vimrc"
fi
if [[ ! -r .config/fish/config.fish ]] ; then
\cp -i "$srcdir/config/fish/config.fish" ".config/fish/config.fish"
fi
for file in "${dotfiles[@]}" ; do
ln -siT "$srcdir/$file" ".$file"
done
ln -siT "$srcdir/profile" ".bash_profile"
if [[ "$1" == "--extra" ]] ; then
[ -d .i3 ] || mkdir .i3
[ -d .config ] || mkdir .config
for file in "${dotfiles_extra[@]}" ; do
ln -siT "$srcdir/$file" ".$file"
done
touch .i3/config.local
touch .repo-dirs
ln -siT "$HOME/edocs/git-credentials" ".git-credentials"
cd "$srcdir"
git submodule sync
git submodule update --init
fi