blob: 89d267e36c274ebb0424e1005a96172d0eb8b8a6 (
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
|
#!/usr/bin/env bash
dotfiles_dir=$(cd -- "$(dirname ${BASH_SOURCE})/.." > /dev/null 2>&1; pwd -P)
mkdir -p "$HOME/.config" "$HOME/.local/share"
remove_and_link () {
for var in $@
do
if [ -L $HOME/$var ] && [ -e $HOME/$var ] && \
[ "$(readlink -- $HOME/$var)" = "$dotfiles_dir/$var" ]; then
continue
fi
rm -v -rf $HOME/$var
ln -v -s $dotfiles_dir/$var $HOME/$var
done
}
link_all () {
remove_and_link .ctags.d .mutt bin .aliases .macos \
.tmux.conf .urlview .zshrc \
.vimrc .vim .path .functions .emacs.d .gitconfig \
.config/i3 .config/polybar .xinitrc .pam_environment \
.zprofile .newsboat .ledgerrc .nnnrc .alacritty.yml .fzfrc .zplugrc \
.env .zrc .config/kitty .wezterm.lua .config/mpv \
.local/share/light-mode.d .local/share/dark-mode.d
}
main () {
if [ $# -eq 0 ] || [ $1 = 'all' ]; then
link_all
return
fi
remove_and_link $@
}
main "$@"
|