-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·72 lines (62 loc) · 1.93 KB
/
setup.sh
File metadata and controls
executable file
·72 lines (62 loc) · 1.93 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
#!/bin/bash
# https://github.com/caarlos0/dotfiles/blob/main/setup
set -euo pipefail
link() {
# check if the command exists
local cmd="${3:-}"
if [ -n "$cmd" ]; then
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Skipping config for '$cmd', not found."
return 0
fi
fi
# link the config directory
mkdir -p "$(dirname "$2")"
if [ -e "$2" ]; then
echo "Skipping $2, already exists."
else
ln -sf "$1" "$2"
echo "Linked $1 to $2"
fi
}
# copy zsh config
if [ ! -e ~/.zshrc.local ]; then
cp ~/.zshrc ~/.zshrc.local
cp -f "$(pwd)/.zshrc" ~/.zshrc
else
echo "~/.zshrc has already been copied"
fi
# create symlinks
link "$(pwd)/config/helix" ~/.config/helix "hx"
link "$(pwd)/config/nvim" ~/.config/nvim "nvim"
link "$(pwd)/config/btop" ~/.config/btop "btop"
link "$(pwd)/config/tmux" ~/.config/tmux "tmux"
link "$(pwd)/config/ghostty" ~/.config/ghostty "ghostty"
link "$(pwd)/config/zed" ~/.config/zed "zed"
# claude code
link "$(pwd)/config/claude/settings.json" ~/.claude/settings.json "claude"
link "$(pwd)/config/claude/statusline.sh" ~/.claude/statusline.sh "claude"
# special case for bat
link "$(pwd)/config/bat" ~/.config/bat "bat"
if command -v bat >/dev/null 2>&1; then
mkdir -p "$(pwd)/config/bat/themes"
if [ -e "$(pwd)/config/bat/themes/rose-pine-moon.tmTheme" ]; then
echo "Bat theme already exists"
else
curl -o "$(pwd)/config/bat/themes/rose-pine-moon.tmTheme" \
"https://raw.githubusercontent.com/rose-pine/tm-theme/main/dist/rose-pine-moon.tmTheme"
bat cache --build
fi
fi
# create shortcut for obsidian vault
if [[ "$(uname)" == "Darwin" ]]; then
case "$(hostname)" in
Kukov-MacBook-Air*)
link "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/Kuko's Vault/" ~/Notes
;;
*)
link "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Kuko's Vault/" ~/Notes
;;
esac
fi
link "$(pwd)/bin/daily_note.sh" ~/.local/bin/standup