-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
Β·158 lines (139 loc) Β· 4.36 KB
/
setup.sh
File metadata and controls
executable file
Β·158 lines (139 loc) Β· 4.36 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
#!/bin/bash
function installPackage() {
local L_INSTALL_CMD=$1
local L_PACKAGE=$2
local L_LIST_PACKAGES=$3
if ! echo "${L_LIST_PACKAGES}" | grep -w -q "${L_PACKAGE}"; then
echo "Installing ${L_PACKAGE}..."
(eval "${L_INSTALL_CMD}" "${L_PACKAGE}" && echo "π ${L_PACKAGE} was successfully installed") || echo "β ${L_PACKAGE}"
else
echo "β
${L_PACKAGE} is already installed"
fi
}
# Install brew if not installed
command -v brew >/dev/null 2>&1 || {
echo >&2 "Installing Homebrew now"; \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; \
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)";
}
INSTALL_CMD="brew install"
LIST_PACKAGES=$(brew list)
# Install zsh
installPackage "${INSTALL_CMD}" "zsh" "${LIST_PACKAGES}"
# Check if oh-my-zsh is installed. If not, install it
if ! command -v zsh >/dev/null 2>&1 || [ ! -d "$HOME/.oh-my-zsh" ]; then
echo >&2 "Installing oh-my-zsh now"; \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s $(which zsh)
else
echo "β
oh-my-zsh is already installed"
fi
# Installing packages
PACKAGES=(
"curl"
"git"
"stow"
"wget"
"atuin"
"bat"
"btop"
"eza"
"fd"
"fzf"
"gh"
"go-task"
"httpie"
"jq"
"tlrc"
"yq"
"zoxide"
"1password-cli"
"rtk"
)
for PACKAGE in "${PACKAGES[@]}"; do
installPackage "${INSTALL_CMD}" "${PACKAGE}" "${LIST_PACKAGES}"
done
echo "π Configuring git..."
git config --global user.name "Γlvaro Paiva"
git config --global user.email alvarofepipa@gmail.com
echo "π Downloading JetBrains Mono font..."
installPackage "brew install --cask" "font-jetbrains-mono" "${LIST_PACKAGES}"
fc-cache -f -v
echo "π Downloading syntax highlighting..."
installPackage "${INSTALL_CMD}" "zsh-syntax-highlighting" "${LIST_PACKAGES}"
echo "π Installing oh-my-zsh plugins..."
if [ ! -d "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab" ]; then
echo "β¬οΈ Cloning fzf-tab..."
git clone https://github.com/Aloxaf/fzf-tab "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab"
else
echo "β
fzf-tab is already present"
fi
echo "π₯οΈ Installing desktop applications..."
if [[ "$OSTYPE" == "darwin"* ]]; then
DESKTOP_APPS=(
"orbstack"
"notion"
)
for DESKTOP_APP in "${DESKTOP_APPS[@]}"; do
installPackage "${INSTALL_CMD}" "${DESKTOP_APP}" "${LIST_PACKAGES}"
done
DESKTOP_APPS_WITH_CASK=(
"iterm2"
"notion-calendar"
"jetbrains-toolbox"
"zen-browser"
"rectangle"
)
for DESKTOP_APP_WITH_CASK in "${DESKTOP_APPS_WITH_CASK[@]}"; do
installPackage "brew install --cask" "${DESKTOP_APP_WITH_CASK}" "${LIST_PACKAGES}"
done
fi
# IT tools
IT_PACKAGES=(
"python"
"node"
"deno"
"docker"
"pulumi"
)
for IT_PACKAGE in "${IT_PACKAGES[@]}"; do
installPackage "${INSTALL_CMD}" "${IT_PACKAGE}" "${LIST_PACKAGES}"
if [ "${IT_PACKAGE}" = "node" ]; then
echo "Installing TypeScript globally..."
npm install -g typescript
echo "Installing Claude Code globally..."
npm install -g @anthropic-ai/claude-code
fi
done
# AI coding agents
echo "π€ Installing AI coding agents..."
# opencode (anomalyco tap β usado pra rotear MiniMax via Anthropic-compat).
# NΓ£o usa installPackage porque `brew list` mostra "opencode" curto, nΓ£o o tap.
if ! brew list opencode >/dev/null 2>&1; then
echo "Installing opencode (anomalyco/tap)..."
brew install anomalyco/tap/opencode && echo "π opencode was successfully installed" || echo "β opencode"
else
echo "β
opencode is already installed"
fi
# Linux-only system packages (apt)
# - gnome-keyring: backend de libsecret pra Emdash/opencode guardarem tokens em
# sessΓ΅es WSL2 sem desktop. Sem isso, "org.freedesktop.secrets was not provided".
if [[ "$OSTYPE" == "linux-gnu"* ]] && command -v apt-get >/dev/null 2>&1; then
APT_PACKAGES=(
"gnome-keyring"
)
echo "π§ Installing apt packages..."
for APT_PACKAGE in "${APT_PACKAGES[@]}"; do
if /usr/bin/dpkg -s "${APT_PACKAGE}" >/dev/null 2>&1; then
echo "β
${APT_PACKAGE} is already installed"
else
echo "Installing ${APT_PACKAGE}..."
sudo apt-get install -y "${APT_PACKAGE}" && echo "π ${APT_PACKAGE} was successfully installed" || echo "β ${APT_PACKAGE}"
fi
done
fi
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Submodule
git submodule update --init --recursive
echo "π Done"