blob: 44e2a686a483194e6220a0f89915d5846abfc763 (
plain)
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
|
#!/bin/bash
set -euo pipefail
# clean out old backups
rm -rf dotfiles-backup
mkdir -p dotfiles-backup
# XDG layout
xcache="${XDG_CACHE_HOME:-${HOME}/.cache}"
xdata="${XDG_DATA_HOME:-${HOME}/.local/share}"
xconfig="${XDG_CONFIG_HOME:-${HOME}/.config}"
userbin="$HOME/.local/bin"
# deploy to XDG dirs
mkdir -p "${xcache}/zsh"
mkdir -p "${xdata}/zsh"
cd config
for d in *
do
dest="${xconfig}/$d"
if [ -e "$dest" ]; then
mv "$dest" "../dotfiles-backup/$d"
fi
ln -sf "$(pwd)/$d" "$dest"
done
cd ..
# deploy to home
cd home
for f in *
do
if [ -e "$HOME/.${f}" ]; then
mv "$HOME/.${f}" "../dotfiles-backup/${f}"
fi
ln -sf "$(pwd)/${f}" "$HOME/.${f}"
done
cd ..
# deploy to user binaries
mkdir -p "$userbin"
cd bin
for f in *
do
if [ -e "$userbin/${f}" ]; then
mv "$userbin/${f}" "../dotfiles-backup/${f}"
fi
ln -sf "$(pwd)/${f}" "$userbin/${f}"
done
cd ..
# install vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall
# create local files
if [ ! -e ~/.config/zsh/00-local.zsh ]; then
cp local/local.zsh config/zsh/00-local.zsh
fi
if [ ! -e ~/.config/git/config-local ]; then
cp local/gitconfig-local config/git/config-local
fi
if [ ! -e ~/.local/share/fonts/sourcecodepro-nerd ]; then
mkdir -p ~/.local/share/fonts/sourcecodepro-nerd
unzip local/SourceCodePro.zip -d ~/.local/share/fonts/sourcecodepro-nerd
echo "Run \'fc-cache -v\' to rebuild your font cache"
fi
dconfig="$xconfig/duplicity"
mkdir -p "$dconfig"
if [ ! -e "$dconfig/config" ]; then
cp local/duplicity-config "$dconfig/config"
fi
if [ ! -e "$dconfig/excludes" ]; then
cp local/duplicity-excludes "$dconfig/excludes"
fi
|