-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
symlink
executable file
·94 lines (80 loc) · 2.46 KB
/
symlink
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
#
# Basic symlinks, safe to run on any system
#
# ============================================================================
# initialize script and dependencies
# ============================================================================
if [[ -z "$DOTFILES" ]]; then
cd -- "$(dirname "$0")/.." || exit 1
DOTFILES="$PWD"
fi
. "${DOTFILES}/lib/helpers.sh"
. "${DOTFILES}/lib/pretty.bash"
export PATH="${DOTFILES}/bin:${PATH}"
# ============================================================================
# Create paths (slow)
# ============================================================================
mkdir -p -- "${HOME}/.cache"
mkdir -p -- "${HOME}/.config"
# Mirror root in ~/.local
# pipx uses this bin dir
mkdir -p -- "${HOME}/.local/bin"
mkdir -p -- "${HOME}/.local/man/man1"
mkdir -p -- "${HOME}/.local/lib/R/library"
mkdir -p -- "${HOME}/.local/share/tig"
# ============================================================================
# Main
# ============================================================================
__symlink() {
__dko_status "Symlinking dotfiles"
# REQUIRED in ~/ -- ag looks for ~/.agignore LAST and includes it.
# .ignore files are for project local only
dko-symlink "shell/dot.profile" \
".profile"
# XDG-compatible, not linux specific
dko-symlink "bat/config" \
".config/bat/config"
dko-symlink "git/dot.gitconfig" \
".config/git/config"
dko-symlink "git/dot.gitignore" \
".config/git/ignore"
dko-symlink "markdownlint/dot.markdownlintrc" \
".config/markdownlint/config"
dko-symlink "mise/config.toml" \
".config/mise/config.toml"
dko-symlink "shell/dot.inputrc" \
".config/readline/inputrc"
# whole wezterm directory
dko-symlink "wezterm" \
".config/wezterm"
dko-symlink "yamlfmt" \
".config/yamlfmt"
# (n)vim / intellij ideavim
dko-symlink "nvim" \
".config/nvim"
dko-symlink "ideavim/dot.ideavimrc" \
".config/ideavim/ideavimrc"
case "$OSTYPE" in
*arwin*)
dko-symlink "mac/hammerspoon" \
".hammerspoon"
dko-symlink "mac/dot.hushlogin" \
".hushlogin"
dko-symlink "mac/dot.mackup.cfg" \
".mackup.cfg"
;;
esac
# Shell
dko-symlink "bash/dot.bashrc" \
".bashrc"
dko-symlink "bash/dot.bash_profile" \
".bash_profile"
dko-symlink "zsh/dot.zshenv" \
".zshenv"
__dko_status "Done! [symlink.sh]"
}
__symlink
if [ -z "${GIT_AUTHOR_NAME}" ]; then
__dko_echo "Don't forget to set up GIT_xxx ENV variables"
fi