@@ -15,6 +15,7 @@ exit_setup() {
15
15
16
16
set -euo pipefail
17
17
trap ' exit_setup' ERR INT
18
+
18
19
symlink () {
19
20
if [[ -e " ${2} " ]]; then
20
21
if [[ ! -L " ${2} " ]]; then
@@ -91,14 +92,14 @@ echo "Setting up GPG/SSH"
91
92
gpg --list-keys > /dev/null
92
93
93
94
declare -a mk_dirs=(
94
- ~ /.cargo
95
- ~ /.config
96
- ~ /.continue
97
- ~ /.local/bin
98
- ~ /.local/share
99
- ~ /.ssh
100
- ~ /Library/KeyBindings
101
- ~ /Library/LaunchAgents
95
+ ~ /.cargo/
96
+ ~ /.config/
97
+ ~ /.continue/
98
+ ~ /.local/bin/
99
+ ~ /.local/share/
100
+ ~ /.ssh/
101
+ ~ /Library/KeyBindings/
102
+ ~ /Library/LaunchAgents/
102
103
)
103
104
104
105
for mk_dir in " ${mk_dirs[@]} " ; do
@@ -122,37 +123,30 @@ rm_if_not_stowed() {
122
123
fi
123
124
fi
124
125
125
- rm -rfv " ${1} "
126
+ rm -rfv " ${1} " || {
127
+ echo " failed to remove conflict path ${1} "
128
+ return 1
129
+ }
126
130
}
127
131
128
132
echo " Checking for files/directories that will conflict with stow"
129
133
for conflict_path in " ${conflict_paths[@]} " ; do
130
134
rm_if_not_stowed " ${conflict_path} "
131
135
done
132
136
137
+ echo " Setting up stow"
138
+ stow -t ~ / stow || {
139
+ echo " failed to setup stow"
140
+ exit 1
141
+ }
142
+
133
143
echo " Appending custom pinentry script to gpg-agent.conf"
134
144
# GNUPG is ridiculous and only allows env-vars in some of the options here, so we have to do this the convoluted way with a line append
135
145
cp -v " $data_path " /gpg/gpg-agent.conf " $base_path " /gpg/.gnupg/gpg-agent.conf || {
136
146
echo " failed to copy gpg-agent.conf from data dir"
137
147
exit 1
138
148
}
139
- echo " pinentry-program $HOME /.local/bin/pinentry-auto" | tee -a " $HOME " /.gnupg/gpg-agent.conf
140
-
141
- # Fix for spacing breaking the space delimited tuples
142
- mv " ${git_submodule_path} " /catppuccin-bat/themes/Catppuccin\ Mocha.tmTheme " ${git_submodule_path} " /catppuccin-bat/themes/Catppuccin-Mocha.tmTheme || {
143
- echo " failed to move catppuccin-bat theme"
144
- exit 1
145
- }
146
-
147
- declare -a symlink_paths_tuples=(
148
- " ${git_submodule_path} /alacritty-theme/themes ${base_path} /alacritty/.config/alacritty/themes"
149
- " ${git_submodule_path} /catppuccin-bat/themes/Catppuccin-Mocha.tmTheme ${base_path} /bat/.config/bat/themes/Catppuccin-Mocha.tmTheme"
150
- " ${git_submodule_path} /catppuccin-helix/themes/default/catppuccin_mocha.toml ${base_path} /helix/.config/helix/themes/catppuccin_mocha.toml"
151
- )
152
- for symlink_paths_tuple in " ${symlink_paths_tuples[@]} " ; do
153
- read -ra symlink_paths <<< " $symlink_paths_tuple"
154
- symlink " ${symlink_paths[0]} " " ${symlink_paths[1]} "
155
- done
149
+ echo " pinentry-program $HOME /.local/bin/pinentry-auto" | tee -a " $base_path " /gpg/.gnupg/gpg-agent.conf
156
150
157
151
stow_config () {
158
152
stow -v " $1 " || {
@@ -167,7 +161,6 @@ declare -a stow_dirs_setup=(
167
161
gpg
168
162
macos
169
163
ssh
170
- stow
171
164
zsh
172
165
)
173
166
@@ -223,16 +216,38 @@ for decrypt_data_paths_tuple in "${decrypt_data_paths_tuples[@]}"; do
223
216
fi
224
217
done
225
218
219
+ # Fix for spacing breaking the space delimited tuples
220
+ mv " ${git_submodule_path} " /catppuccin-bat/themes/Catppuccin\ Mocha.tmTheme " ${git_submodule_path} " /catppuccin-bat/themes/Catppuccin-Mocha.tmTheme || {
221
+ echo " failed to move catppuccin-bat theme"
222
+ exit 1
223
+ }
224
+
225
+ declare -a symlink_paths_tuples=(
226
+ " ${git_submodule_path} /alacritty-theme/themes ${base_path} /alacritty/.config/alacritty/themes"
227
+ " ${git_submodule_path} /catppuccin-bat/themes/Catppuccin-Mocha.tmTheme ${base_path} /bat/.config/bat/themes/Catppuccin-Mocha.tmTheme"
228
+ " ${git_submodule_path} /catppuccin-helix/themes/default/catppuccin_mocha.toml ${base_path} /helix/.config/helix/themes/catppuccin_mocha.toml"
229
+ )
230
+ for symlink_paths_tuple in " ${symlink_paths_tuples[@]} " ; do
231
+ read -ra symlink_paths <<< " $symlink_paths_tuple"
232
+ symlink " ${symlink_paths[0]} " " ${symlink_paths[1]} "
233
+ done
234
+
226
235
declare -a stow_dirs_general=(
227
236
alacritty
228
237
bat
229
238
continue
230
239
helix
231
240
nvim
241
+ omz
232
242
rust
233
243
)
234
244
235
245
echo " Stowing general configs"
236
246
for stow_dir in " ${stow_dirs_general[@]} " ; do
237
247
stow_config " $stow_dir "
238
248
done
249
+
250
+ defaults write com.apple.finder AppleShowAllFiles -boolean true || {
251
+ echo " failed to enable hidden files in Finder"
252
+ exit 1
253
+ }
0 commit comments