-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·62 lines (50 loc) · 1.52 KB
/
deploy.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
#!/bin/bash
# the script is ideally completely idempotent
set -e
# fzf
if ! [ -d "$HOME/.fzf" ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf
~/.fzf/install
echo "Installed FZF"
else
echo "FZF already present"
fi
if ! [[ -d "$HOME/.local/share/zinit" ]]; then
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
else
echo "Zinit already present"
fi
# current script location
cwd="$(dirname "$0")"
cwd="$(cd $cwd; pwd)"
config_dir="$cwd/configs"
# for XDG_CONFIG_HOME
xdg_source_dir="$cwd/xdg_configs"
xdg_dir="$HOME/.config"
mkdir -p $xdg_dir
# potentially the one introduced by oh-my-zsh
# removing and relinking is idempotent
if [ -e "$HOME/.zshrc" ]; then
rm $HOME/.zshrc
fi
# make zoxide database dir
mkdir -p "$HOME/.data/zoxide"
# Use stow to manage symlinks
#
# stow _superficially_ does not allow source to contain slashes,
# but we can simply make sure to call it from the containing directory.
# Link all $HOME dotfiles, including the various RC files and zsh dir.
stow --dotfiles -v --target="$HOME" "configs"
stow --dotfiles -v --target="$xdg_dir" "xdg_configs"
# tpm
if ! [ -d "$xdg_dir/tmux/plugins/tpm" ]; then
git clone https://github.com/tmux-plugins/tpm $xdg_dir/tmux/plugins/tpm
echo "Installing TPM"
else
echo "TPM already installed"
fi
# setting up variation software
if type fdfind 2>/dev/null; then
ln -sf $(which fdfind) "$HOME/.local/bin/fd"
fi
echo "successfully deployed dotfiles."