-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·118 lines (97 loc) · 3.84 KB
/
Copy pathinstall
File metadata and controls
executable file
·118 lines (97 loc) · 3.84 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/env bash
# vim: ft=bash
set -euo pipefail
function link_file() {
SRC="${1}"
shift
DEST="${1}"
shift
mkdir -p "$(dirname "${DEST}")"
if [ -L "${DEST}" ]; then
echo "File ${DEST} already linked; skipping"
elif [ -e "${DEST}" ]; then
mv "${DEST}" "${DEST}_$(date +%s)"
ln -s "${SRC}" "${DEST}"
else
# Neither already linked, nor a concrete file.
ln -s "${SRC}" "${DEST}"
fi
}
link_file "${HOME}/abrazo/alias" "${HOME}/.alias"
link_file "${HOME}/abrazo/alias.sh" "${HOME}/.alias.sh"
link_file "${HOME}/abrazo/api_keys.sh" "${HOME}/.api_keys.sh"
link_file "${HOME}/abrazo/tmux.conf" "${HOME}/.tmux.conf"
link_file "${HOME}/abrazo/tmux/config.sh" "${HOME}/.config/tmux-powerline/config.sh"
link_file "${HOME}/abrazo/tmux/merlin.sh" "${HOME}/.config/tmux-powerline/themes/merlin.sh"
link_file "${HOME}/abrazo/bashrc" "${HOME}/.bashrc"
link_file "${HOME}/abrazo/bash_profile" "${HOME}/.bash_profile"
link_file "${HOME}/abrazo/gitconfig" "${HOME}/.gitconfig"
link_file "${HOME}/abrazo/git_template" "${HOME}/.git_template"
link_file "${HOME}/abrazo/vimrc" "${HOME}/.vimrc"
link_file "${HOME}/abrazo/toprc" "${HOME}/.toprc"
link_file "${HOME}/abrazo/flox" "${HOME}/.flox"
link_file "${HOME}/abrazo/emacs.d" "${HOME}/.emacs.d"
link_file "${HOME}/abrazo/nvim" "${HOME}/.config/nvim"
link_file "${HOME}/abrazo/nvim" "${HOME}/.var/app/io.neovim.nvim/config/nvim"
link_file "${HOME}/abrazo/jj" "${HOME}/.config/jj"
link_file "${HOME}/abrazo/zellij" "${HOME}/.config/zellij"
link_file "${HOME}/abrazo/leadr" "${HOME}/.config/leadr"
link_file "${HOME}/abrazo/powerline" "${HOME}/.config/powerline"
pushd fish
./fish_install.fish
popd
OS=$(uname | tr 'A-Z' 'a-z')
link_file "${HOME}/kitty/font-${OS}.conf" "${HOME}/.config/kitty/font.conf"
export fileList=("current-theme" "kitty" "ligatures")
for file in "${fileList[@]}"; do
link_file "${HOME}/abrazo/kitty/${file}.conf" "${HOME}/.config/kitty/${file}.conf"
done
if [ -d "${HOME}/.tmux/plugins/tpm" ]; then
pushd "${HOME}/.tmux/plugins/tpm"
git pull
popd
else
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
# Nushell: link the config dir and seed init/completion caches that autoload expects
# at parse time. Each step is gated on its binary being present so a fresh machine
# without the full cargo/brew battery installed doesn't abort.
link_file "${HOME}/abrazo/nushell" "${HOME}/.config/nushell"
# Prompt/navigation init scripts (sourced from autoload/{starship,zoxide}.nu)
if command -v starship >/dev/null 2>&1; then
mkdir -p "${HOME}/.cache/starship"
starship init nu > "${HOME}/.cache/starship/init.nu"
fi
if command -v zoxide >/dev/null 2>&1; then
mkdir -p "${HOME}/.cache/zoxide"
zoxide init nushell > "${HOME}/.cache/zoxide/init.nu"
fi
# Native nushell completions for atuin, jj, just, starship (self-gating on binary)
if command -v nu >/dev/null 2>&1; then
nu "${HOME}/abrazo/nushell/regenerate-completions.nu"
fi
# jj-gh-pr.nu — `jj pr create/merge/view/update` via gh
if [ -d "${HOME}/.local/share/jj-gh-pr" ]; then
pushd "${HOME}/.local/share/jj-gh-pr"
git pull --ff-only
popd
else
git clone https://github.com/eopb/jj-gh-pr.nu "${HOME}/.local/share/jj-gh-pr"
fi
# LS_COLORS — extended dircolors database (sourced from shell rc)
mkdir -p "${HOME}/git"
if [ -d "${HOME}/git/LS_COLORS" ]; then
pushd "${HOME}/git/LS_COLORS"
git pull --ff-only
popd
else
git clone https://github.com/trapd00r/LS_COLORS "${HOME}/git/LS_COLORS"
fi
# Cache LS_COLORS as a nushell init script (autoload/ls-colors.nu sources it).
if command -v dircolors >/dev/null 2>&1 && [ -f "${HOME}/git/LS_COLORS/LS_COLORS" ]; then
mkdir -p "${HOME}/.cache/ls-colors"
ls_colors_value=$(dircolors -b "${HOME}/git/LS_COLORS/LS_COLORS" \
| sed -n "s/^LS_COLORS='\(.*\)';.*/\1/p")
printf "\$env.LS_COLORS = '%s'\n" "${ls_colors_value}" \
> "${HOME}/.cache/ls-colors/init.nu"
fi