-
Notifications
You must be signed in to change notification settings - Fork 0
/
_install.sh
executable file
·179 lines (155 loc) · 5.07 KB
/
_install.sh
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#!/bin/bash
OS_NAME=$(uname -s)
# ASCII font generated with `figlet -f isometric1 MacOS`
# shellcheck disable=SC1004
ASCII_MACOS='
___ ___ ___ ___ ___
/\__\ /\ \ /\ \ /\ \ /\ \
/::| | /::\ \ /::\ \ /::\ \ /::\ \
/:|:| | /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\ \ \
/:/|:|__|__ /::\~\:\ \ /:/ \:\ \ /:/ \:\ \ _\:\~\ \ \
/:/ |::::\__\ /:/\:\ \:\__\ /:/__/ \:\__\ /:/__/ \:\__\ /\ \:\ \ \__\
\/__/~~/:/ / \/__\:\/:/ / \:\ \ \/__/ \:\ \ /:/ / \:\ \:\ \/__/
/:/ / \::/ / \:\ \ \:\ /:/ / \:\ \:\__\
/:/ / /:/ / \:\ \ \:\/:/ / \:\/:/ /
/:/ / /:/ / \:\__\ \::/ / \::/ /
\/__/ \/__/ \/__/ \/__/ \/__/
'
# ASCII font generated with `figlet -f isometric1 Linux`
# shellcheck disable=SC1004
ASCII_LINUX='
___ ___ ___ ___
/\__\ ___ /\__\ /\__\ |\__\
/:/ / /\ \ /::| | /:/ / |:| |
/:/ / \:\ \ /:|:| | /:/ / |:| |
/:/ / /::\__\ /:/|:| |__ /:/ / ___ |:|__|__
/:/__/ __/:/\/__/ /:/ |:| /\__\ /:/__/ /\__\ ____/::::\__\
\:\ \ /\/:/ / \/__|:|/:/ / \:\ \ /:/ / \::::/~~/~
\:\ \ \::/__/ |:/:/ / \:\ /:/ / ~~|:|~~|
\:\ \ \:\__\ |::/ / \:\/:/ / |:| |
\:\__\ \/__/ /:/ / \::/ / |:| |
\/__/ \/__/ \/__/ \|__|
'
###############################################################################
# Helpers #
###############################################################################
# Log a message with a timestamp
# Arguments:
# Message
function _log() {
message="$1"
echo "$(date +"%T") - ${message}"
}
###############################################################################
# MacOS #
###############################################################################
if [ "$OS_NAME" = 'Darwin' ]; then
echo "$ASCII_MACOS"
# Install Homewbrew
if command -v brew >/dev/null; then
_log "Homebrew is already installed"
else
_log "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Install core packages and casks (NOTE: one can find a list of top-level packages with `brew
# leaves`)
_log "Installing brew packages"
brew install \
bash \
bash-completion \
bat \
chatblade \
cmake \
curl \
direnv \
duckdb \
eza \
fd \
ffmpeg \
figlet \
fzf \
gh \
git \
httpie \
imagemagick \
jq \
llm \
neovim \
node \
nvm \
openssh \
pass \
pass-otp \
pdfgrep \
pinentry-mac \
pnpm \
pre-commit \
pyenv \
pyenv-virtualenv \
ranger \
ripgrep \
shfmt \
stow \
stylua \
the_silver_searcher \
tldr \
tmux \
watch \
withgraphite/tap/graphite \
yarn \
uv
_log "Installing brew casks"
brew install --cask \
docker \
hammerspoon \
kitty \
linear-linear \
mpv \
notion \
notion notion-calendar \
slack \
snowflake-snowsql \
spotify \
zoom
_log "Installing LTS version of Node.js"
nvm install --lts
_log "Installing Tmux Plugin Manager"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# NOTE: this threw an error
if [ ! -f ~/.hammerspoon/Spoons/SpoonInstall.spoon ]; then
_log 'Installing Hammerspoon SpoonInstall.spoon'
curl -O -L https://github.com/Hammerspoon/Spoons/raw/master/Spoons/SpoonInstall.spoon.zip
unzip SpoonInstall.spoon.zip
open SpoonInstall.spoon
fi
_log 'NOTE: If Chromium.app fails to open, run: xattr -cr /Applications/Chromium.app'
fi
if [ "$OS_NAME" = 'Linux' ]; then
echo "$ASCII_LINUX"
# Install core packages with `pacman` (NOTE: one can find a list of
# installed packages using `pacman -Qe`)
if command -v pacman >/dev/null; then
_log "Refreshing and upgrading system via Pacman"
sudo pacman -Syu --noconfirm >/dev/null
_log "Installing packages via pacman"
sudo pacman -S --noconfirm \
bash-completion \
bat \
eza \
fd \
fzf \
git \
jq \
neovim \
openssh \
stow \
sudo \
the_silver_searcher \
tldr \
tmux \
unzip \
zip \
&>/dev/null
fi
fi