-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup
More file actions
executable file
·102 lines (88 loc) · 3.11 KB
/
setup
File metadata and controls
executable file
·102 lines (88 loc) · 3.11 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
#!/bin/bash
set -euo pipefail
info() { echo -e " \033[38;5;252m $*\033[0m"; }
success() { echo -e " \033[32m\033[1m $*\033[0m"; }
warn() { echo -e " \033[38;5;137m $*\033[0m"; }
link() {
mkdir -p "$(dirname "$2")"
if [ -L "$2" ]; then
ln -sfn "$1" "$2"
elif [ -e "$2" ]; then
warn "Skipping $2, real file exists (move it aside to link)."
else
ln -s "$1" "$2"
success "Linked $1 to $2"
fi
}
info "Setting caarlos0/dotfiles up"
# bins
link "$PWD"/bin ~/.bin
if which tmux; then
link "$PWD"/tmux/tmux.conf ~/.config/tmux/tmux.conf
tmux source ~/.config/tmux/tmux.conf
fi
# shell
link "$PWD"/fish/functions ~/.config/fish/functions
link "$PWD"/fish/themes ~/.config/fish/themes
link "$PWD"/fish/config.fish ~/.config/fish/config.fish
fish -c "fish_config theme choose catppuccin-mocha" ||
warn "catppuccin-mocha theme not found, skipping"
# ssh
for f in "$PWD"/ssh/*; do
link "$f" ~/.ssh/"$(basename "$f")"
done
if [[ $OSTYPE == 'darwin'* ]] && [ -f ~/.ssh/id_ed25519 ]; then
ssh-add --apple-use-keychain ~/.ssh/id_ed25519 &>/dev/null ||
warn "Could not add SSH key to keychain, skipping"
fi
# terms
link "$PWD"/ghostty/config ~/.config/ghostty/config
link "$PWD"/rio ~/.config/rio
# neovim
if which nvim &>/dev/null; then
link "$PWD"/nvim ~/.config/nvim
nvim --headless "+Lazy! sync" +qa &>/dev/null
fi
# copilot
if which copilot &>/dev/null; then
if ! copilot plugin list | grep -q superpowers-marketplace; then
copilot plugin install superpowers@superpowers-marketplace
copilot plugin marketplace add obra/superpowers-marketplace
success "Installed obra/superpowers"
fi
if ! copilot plugin list | grep -q doublecheck; then
copilot plugin install doublecheck@awesome-copilot
success "Installed awesome-copilot/doublecheck"
fi
fi
mkdir -p ~/.copilot/{agents,skills}/
wget -qcO ~/.copilot/agents/caarlos0.agent.md https://raw.githubusercontent.com/merencia/pairwith/refs/heads/main/profiles/caarlos0.md
wget -qcO ~/.copilot/agents/merencia.agent.md https://raw.githubusercontent.com/merencia/pairwith/refs/heads/main/profiles/merencia.md
for skill in "$PWD"/skills/*; do
[ -d "$skill" ] || continue
link "$skill" ~/.copilot/skills/"$(basename "$skill")"
done
# other apps
link "$PWD"/.editorconfig ~/.editorconfig
link "$PWD"/hammerspoon/init.lua ~/.hammerspoon/init.lua
link "$PWD"/btop/btop.conf ~/.config/btop/btop.conf
link "$PWD"/git/config ~/.config/git/config
link "$PWD"/git/gitignore ~/.config/git/ignore
link "$PWD"/gh/config.yml ~/.config/gh/config.yml
link "$PWD"/gh-dash/config.yml ~/.config/gh-dash/config.yml
link "$PWD"/fd/ignore ~/.config/fd/ignore
link "$PWD"/direnv ~/.config/direnv
link "$PWD"/copilot/copilot-instructions.md ~/.copilot/copilot-instructions.md
if [[ $OSTYPE == 'darwin'* ]]; then
brew bundle &>/dev/null
fi
# Fish setup
if ! grep -q fish /etc/shells; then
info "Adding $(which fish) to /etc/shells - will ask sudo password"
which fish | sudo tee -a /etc/shells
fi
if ! finger "$USER" | grep -q 'Shell: .*fish'; then
info "Setting $(which fish) as the default shell - will ask user password"
chsh -s "$(which fish)"
fi
success "All done!"