-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.zsh
More file actions
executable file
·163 lines (135 loc) · 3.41 KB
/
setup.zsh
File metadata and controls
executable file
·163 lines (135 loc) · 3.41 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/zsh
local SETUP_SCRIPT_PATH="$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
ERROR='\033[0;31m[ERROR] '
WARN='\033[0;33m[WARN] '
NC='\033[0m' # No Color
OK='\033[0;32m[OK] '
INFO='\033[0;34m[INFO] '
# Use the appropriate package manager based on the OS
function install_packages_arch() {
local packages=("$@")
for package in "${packages[@]}"; do
if ! yay -Qi "$package" &>/dev/null; then
echo -e "${OK}Installing $package...${NC}"
sudo yay -S --noconfirm "$package"
else
echo -e "${INFO}$package is already installed${NC}"
fi
done
}
function install_packages_mac() {
if ! command -v brew &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
local packages=("$@")
for package in "${packages[@]}"; do
if ! brew list | grep -q "^$package\$"; then
echo -e "${OK}Installing $package...${NC}"
brew install "$package"
else
echo -e "${INFO}$package is already installed${NC}"
fi
done
}
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
install_packages() {
install_packages_arch "$@"
}
elif [[ "$OSTYPE" == "darwin"* ]]; then
install_packages() {
install_packages_mac "$@"
}
else
echo -e "${ERROR}Unsupported OS: $OSTYPE${NC}"
exit 1
fi
# Create .config directory if it doesn't exist
# --------------------------------------------
mkdir -p ~/.config
# GNU Stow for dotfiles management
# --------------------------------
install_packages stow
stow .
source ~/.zshrc
# Git
# ---
install_packages git
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
install_packages github-cli
elif [[ "$OSTYPE" == "darwin"* ]]; then
install_packages gh
fi
git config --global core.editor "nvim"
source ~/.zshrc
# Curl
# ----
install_packages curl
source ~/.zshrc
# Alacritty
# ---------
install_packages alacritty
# Powerlevel10k
# -------------
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
install_packages zsh-theme-powerlevel10k
elif [[ "$OSTYPE" == "darwin"* ]]; then
install_packages powerlevel10k
fi
# Zsh plugins
# -----------
install_packages zsh-syntax-highlighting
install_packages zsh-autosuggestions
install_packages zsh-vi-mode
# Fonts
# -----
# https://www.nerdfonts.com/cheat-sheet
# https://www.nerdfonts.com
if [[ "$OSTYPE" == "darwin"* ]]; then
install_packages font-jetbrains-mono-nerd-font
install_packages font-iosevka-nerd-font
install_packages font-maple-mono-nf
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
install_packages ttf-jetbrains-mono-nerd
install_packages ttf-iosevka-nerd
install_packages ttf-maple-mono-nf
fc-cache -fv >/dev/null
fi
# Node.js / NPM / Yarn
# -------
install_packages nvm yarn
# Go
# --
install_packages goenv
goenv global latest
source ~/.zshrc
# Install Delve (Go Debugger)
go install github.com/go-delve/delve/cmd/dlv@latest
# Python
# ------
install_packages pyenv
pyenv install 3.13 -s
pyenv global 3.13
source ~/.zshrc
# NeoVim
# ------
install_packages neovim ripgrep fzf fd
# Tmux
# ----
install_packages tmux
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
# Lazygit / Lazydocker
# -------
install_packages lazygit lazydocker
# Fastfetch
# ---------
install_packages fastfetch
# Opencode
# ---------
install_packages opencode
opencode github install
source ~/.zshrc