-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
496 lines (435 loc) · 14.2 KB
/
Makefile
File metadata and controls
496 lines (435 loc) · 14.2 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
DOTFILES := $(CURDIR)
BOOTSTRAP_DIR := $(CURDIR)/scripts/bootstrap
MKDIR := mkdir -pv
LN := ln -svf
LNDIR := ln --symbolic --verbose
PKGMAN := $(shell command -v paru >/dev/null 2>&1 && printf '%s' paru || printf '%s' sudo pacman)
AURINSTALL = paru --sync --needed
STOW := stow --target=$(HOME)
CAT := $(shell command -v bat >/dev/null 2>&1 && printf '%s' bat || printf '%s' cat)
XDG_DATA_HOME := $(shell [ -n "$$XDG_DATA_HOME" ] && printf %s "$$XDG_DATA_HOME" || printf %s "$(HOME)/.local/share")
XDG_CACHE_HOME := $(shell [ -n "$$XDG_CACHE_HOME" ] && printf %s "$$XDG_CACHE_HOME" || printf %s "$(HOME)/.cache")
XDG_CONFIG_HOME := $(shell [ -n "$$XDG_CONFIG_HOME" ] && printf %s "$$XDG_CONFIG_HOME" || printf %s "$(HOME)/.config")
XDG_STATE_HOME := $(shell [ -n "$$XDG_STATE_HOME" ] && printf %s "$$XDG_STATE_HOME" || printf %s "$(HOME)/.local/state")
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
OS := macos
PKGINSTALL := brew install
else ifeq ($(UNAME_S),Linux)
OS := linux
PKGINSTALL := $(PKGMAN) --sync --needed
else ifeq ($(UNAME_S),OpenBSD)
OS := openbsd
else ifneq (,$(findstring MINGW,$(UNAME_S)))
OS := windows
else
OS := unknown
endif
#by using ‘sudo -E make’ or ‘sudo -Es’ before running make, would source your env and make it available for sudoer.
# Stow packages
# Find subdirs and make them under $HOME
MAKE_DIRS = cd $@ && \
find . -type d -print | sed 's|^\./||' | while IFS= read -r dir; do \
[ -n "$$dir" ] && $(MKDIR) "$$HOME/$$dir"; \
done
.PHONY: all clean stow aur pacman wayland xorg shellbase bash navi zoxide bin rust neovim vifm fzf dropbox xdg-dirs vim vim-base bat tmux lf wezterm thesaurus
all: vim neovim vim-base
pacman:
$(MKDIR) $(HOME)/.config/pacman
# do i do a -si for pacman config or do i copy the pacman.conf
# or do i run a diff of pacman.conf and what is in my dotfiles?
# install to /etc/pacman.d/hooks more on install -- helpful for automating SO MUCH
sudoas:
$(PKGINSTALL) doas
@printf "configure doas"
@printf "configure sudo"
@printf "doas visudo"
@printf "uncomment Defaults targetpw"
@printf "uncomment ALL ALL = (ALL:ALL) ALL"
@printf "replace the first all with username allowed to sudo"
aur:
$(MKDIR) $(XDG_CACHE_HOME)/aur/aur
$(MKDIR) $(XDG_CACHE_HOME)/aur/pkgbuilds
$(MKDIR) $(XDG_CACHE_HOME)/aur/build/sources
$(MKDIR) $(XDG_CACHE_HOME)/aur/build/srcpackages
$(MKDIR) $(XDG_CACHE_HOME)/aur/build/makepkglogs
paru:
$(MKDIR) $(XDG_CONFIG_HOME)/paru
sudo pacman --sync --needed base-devel
@if [ -d "$(XDG_CACHE_HOME)/aur/pkgbuilds/paru" ]; then \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds/paru" && \
git pull; \
else \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds" && \
git clone https://aur.archlinux.org/paru.git && \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds/paru"; \
fi; \
makepkg --syncdeps --install
stow paru
yay:
$(MKDIR) $(XDG_CONFIG_HOME)/yay
sudo pacman --sync --needed base-devel
@if [ -d "$(XDG_CACHE_HOME)/aur/pkgbuilds/yay" ]; then \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds/yay" && \
git pull; \
else \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds" && \
git clone https://aur.archlinux.org/yay.git && \
cd "$(XDG_CACHE_HOME)/aur/pkgbuilds/yay"; \
fi; \
makepkg --syncdeps --install
stow yay
yay-init: ## on first use, development packages upgrade
yay -Y --gendb
yay -Syu --devel
dropbox: ## Install dropbox on arch via AUR and update related configs
$(AURINSTALL) dropbox dropbox-cli
@printf "%s\n" "Prevent automatic updates"
@rm -rf $(HOME)/.dropbox-dist
@install -dm0 $(HOME)/.dropbox-dist
@printf "%s\n" "Fix Arch filesystem monitoring problem (inotify fix)"
@if ! grep -q '^fs.inotify.max_user_watches=3000000' /etc/sysctl.d/99-sysctl.conf 2>/dev/null; then \
printf "Adding fs.inotify.max_user_watches setting...\n"; \
echo "fs.inotify.max_user_watches=3000000" | sudo tee -a /etc/sysctl.d/99-sysctl.conf > /dev/null; \
sudo sysctl --system; \
else \
printf "%s\n" "fs.inotify.max_user_watches is already set to 3000000"; \
fi
printf "%s\n" "enable and start dropbox systemd service"
stow dropbox
systemctl --user daemon-reload
systemctl --user enable --now dropbox
stow: stowrc stowignore
stowrc:
@printf "==> Linking .stowrc"
@if [ -e "$(HOME)/.stowrc" ] && [ ! -L "$(HOME)/.stowrc" ]; then \
printf "ERROR: $(HOME)/.stowrc exists and is not a symlink. Refusing to overwrite."; \
exit 1; \
else \
$(LN) $(DOTFILES)/stow/.stowrc $(HOME)/.stowrc; \
fi
stowignore:
@printf "==> Linking .stow-global-ignore"
@if [ -e "$(HOME)/.stow-global-ignore" ] && [ ! -L "$(HOME)/.stow-global-ignore" ]; then \
printf "ERROR: $(HOME)/.stow-global-ignore exists and is not a symlink. Refusing to overwrite."; \
exit 1; \
else \
$(LN) $(DOTFILES)/stow/.stow-global-ignore $(HOME)/.stow-global-ignore; \
fi
git:
$(STOW) git
vim-base:
@printf "cloning submodule for vim-infolines\n"
@git submodule update --init --recursive
$(STOW) vim-base
vim:
$(MAKE) vim-base
$(MKDIR) $(XDG_STATE_HOME)/vim
$(MKDIR) $(XDG_STATE_HOME)/vim/undodir
$(MKDIR) $(XDG_STATE_HOME)/vim/backup
$(MKDIR) $(XDG_STATE_HOME)/vim/swap
$(MKDIR) $(XDG_DATA_HOME)/vim
$(STOW) vim
neovim:
$(MAKE) vim-base
$(MKDIR) $(XDG_STATE_HOME)/nvim
$(MKDIR) $(XDG_STATE_HOME)/nvim/undodir
$(MKDIR) $(XDG_STATE_HOME)/nvim/backup
$(MKDIR) $(XDG_STATE_HOME)/nvim/swap
$(STOW) nvim
get-dicts: # run the script to get word lists and thesaurus
@$ $(BOOTSTRAP_DIR)/get-dictionaries-thesaurus.sh
nvim:
$(MAKE) neovim
clean:
$(STOW) -D $(STOW_PACKAGES)
arch-linux:
$(PKGINSTALL) neovim nodejs npm
$(PKGINSTALL) lf ouch fzf zoxide trash-cli
$(PKGINSTALL) zoxide fzf
wayland:
$(PKGINSTALL) \
river \
wlr-randr \
fuzzel \
dunst \
swayidle \
swaylock \
wl-clipboard \
cliphist #unsure
tmux:
$(MKDIR) $(XDG_CONFIG_HOME)/tmux
$(MKDIR) $(XDG_CONFIG_HOME)/tmux/sessionizer
@$(STOW) tmux
xorg:
$(PKGINSTALL) \
xclip
shbase:
@printf "shell"
@$(STOW) sh-base
shbash:
$(MKDIR) $(XDG_DATA_HOME)/bash
@$(STOW) sh-bash
shzsh:
$(MKDIR) $(XDG_DATA_HOME)/zsh
@$(STOW) sh-zsh
zoxide:
zoxide add $(HOME)/dotfiles
zoxide add $(XDG_CONFIG_HOME)
zoxide add $(HOME)/Downloads
zoxide add $(HOME)/Dropbox
zoxide add $(HOME)/Dropbox/shm
zoxide add $(HOME)/src
zoxide add $(HOME)/projects
navi:
$(PKGINSTALL) navi fzf
$(MKDIR) $(XDG_DATA_HOME)/navi/cheats
$(MKDIR) $(XDG_CONFIG_HOME)/navi
bin:
$(MKDIR) $(HOME)/.local/bin
$(STOW) scripts
vifm:
$(MKDIR) $(XDG_CONFIG_HOME)/vifm
$(MKDIR) $(XDG_CONFIG_HOME)/vifm/scripts
$(MKDIR) $(XDG_CONFIG_HOME)/vifm/colors
$(MKDIR) $(XDG_DATA_HOME)/Trash/files
$(MKDIR) $(XDG_DATA_HOME)/Trash/info
$(MKDIR) $(HOME)/src
@cd "$(HOME)/src" && \
if [ -d vifm-sixel-preview/.git ]; then \
printf "Updating vifm-sixel-preview..."; \
cd vifm-sixel-preview && git pull --ff-only; \
else \
printf "Cloning vifm-sixel-preview..."; \
git clone https://github.com/eylles/vifm-sixel-preview; \
fi && \
cd "$(HOME)/src/vifm-sixel-preview" && \
$(CAT) ./vifm-sixel && \
printf "\nInstall vifm-sixel-preview? [y/N] " && \
read inst && case "$$inst" in [yY]) \
cp -i -v ./vifm-sixel $(XDG_CONFIG_HOME)/vifm/scripts/vifm-sixel && \
chmod +x $(XDG_CONFIG_HOME)/vifm/scripts/vifm-sixel ;; \
esac
$(STOW) vifm
lf:
$(MKDIR) $(XDG_CONFIG_HOME)/lf
$(MKDIR) $(XDG_DATA_HOME)/Trash/files
$(MKDIR) $(XDG_DATA_HOME)/Trash/info
$(MKDIR) $(XDG_DATA_HOME)/lf
install -m 644 $(DOTFILES)/lf/.config/lf/marks-shm $(XDG_DATA_HOME)/lf/marks
$(STOW) lf
rust:
$(MKDIR) $(HOME)/.cargo/bin
@printf "Setting up rust from https://rustup.rs/..."
@curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
@. $(HOME)/.cargo/env
@printf "Installing the latest stable Rust toolchain (rustc, cargo, rustup)"
@rustup default stable
@printf "Verifying installation..."
@rustc --version
@cargo --version
@printf "Installing the rust linter (clippy) and code formatter (Rustfmt)"
@rustup component add clippy rustfmt
@printf "Installing common cargo tools..."
@printf "cargo-edit: manage dependencies"
@printf "cargo-watch: automatically recompile on file changes"
@printf "cargo-outdated: check outdated dependencies"
@cargo install cargo-edit cargo-watch cargo-outdated
@printf "install rust-alalyzer lsp"
@rustup component add rust-analyzer
@printf "install lldb and gdb for debugging; gcc for linking?\n"
@printf "press return to install via pacman/paru or ctl+c to quit\n"
@read dummy
$(PKGINSTALL) lldb gdb gcc
go-install:
@printf "Install go from https://go.dev/dl/"
@printf "Exit the shell before calling make go-setup"
go-setup:
@go version
@printf "Installing go lsp gopls...\n"
@go install golang.org/x/tools/gopls@latest
@printf "Installing go debugger delve...\n"
@go install github.com/go-delve/delve/cmd/dlv@latest
@printf "Installing goimports...\n"
@go install golang.org/x/tools/cmd/goimports@latest
@printf "Installing staticcheck linter...\n"
@go install honnef.co/go/tools/cmd/staticcheck@latest
fzf:
$(PKGINSTALL) fzf
bat:
$(MKDIR) "$(XDG_CONFIG_HOME)/bat/themes"
$(STOW) bat
bat cache --build
hledger:
$(PKGINSTALL) hledger miller
xdg-dirs:
$(MKDIR) "$(HOME)/.local/share"
$(MKDIR) "$(HOME)/.cache"
$(MKDIR) "$(HOME)/.config"
$(MKDIR) "$(HOME)/.local/state"
xcode-dev:
xcode-select --install
filevault:
fdesetup status
sudo fdesetup enable --user "$(USER)"
fdesetup status
nerdfont: ## Install CommitMono NerdFont on macOS
if [ "$(OS)" = "macos" ]; then \
if ls ~/Library/Fonts/CommitMono*Nerd*.*tf >/dev/null 2>&1; then \
printf "CommitMono Nerd Font is already installed.\n"; \
else \
curl --location --output $(HOME)/Downloads/CommitMono.zip https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CommitMono.zip
$(MKDIR) $(HOME)/Downloads/CommitMono
unzip -o $(HOME)/Downloads/CommitMono.zip -d $(HOME)/Downloads/CommitMono
open -a "Font Book" \
fi \
else \
printf "nerdfont download and install skipped, not on macOS (OS = %s)\n" "$$(OS)"; \
fi
macos-base:
$(MAKE) xcode-dev
$(MAKE) xdg-dirs
$(MAKE) filevault
@$ $(BOOTSTRAP_DIR)/m-enable-touch-id-sudo.sh
@$ $(BOOTSTRAP_DIR)/m-set-defaults-preferences.sh
$(MAKE) nerdfont
$(MAKE) stow
# add my user to the developer group
sudo dscl . append /Groups/_developer GroupMembership $(whoami)
# defaults write -g ApplePressAndHoldEnabled -bool false
@$ $(BOOTSTRAP_DIR)/m-list-apps.sh
macos-cli:
$(MAKE) git
$(MAKE) zoxide
$(MAKE) shbase
$(MAKE) shzsh
$(MAKE) shbash
$(MAKE) bin
$(MAKE) vim
$(MAKE) neovim
homebrew-install:
@$ $(HOME)/dotfiles/homebrew/homebrew-install.sh
macos-homebrew:
$(MAKE) macos-base
$(MAKE) homebrew-install
@$ $(BOOTSTRAP_DIR)/m-enable-touch-id-sudo.sh
@$ $(BOOTSTRAP_DIR)/m-chsh-bash.sh
brew-maint:
@$ $(HOME)/dotfiles/homebrew/homebrew-maintenance.sh
shell-scripting:
$(PKGINSTALL) shfmt shellcheck
typst:
$(PKGINSTALL) typst tinymist
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
wikiman:
$(MKDIR) $(HOME)/projects
@if [ -d "$(HOME)/projects/wikiman" ]; then \
cd "$(HOME)/projects/wikiman" && \
git pull; \
else \
cd "$(HOME)/projects" && \
git github.com/shmcgrath/wikiman; \
fi; \
@printf "%s\n" "wikiman downloaded. use wikiman makefile to install docs and wikiman"
wezterm:
curl -o "/tmp/wezterm.terminfo" "https://raw.githubusercontent.com/wezterm/wezterm/main/termwiz/data/wezterm.terminfo"
if [ "$(OS)" = "macos" ]; then \
$(MKDIR) $(HOME)/.terminfo; \
tic -x -o $(HOME)/.terminfo "/tmp/wezterm.terminfo"; \
else \
$(MKDIR) $(XDG_DATA_HOME)/terminfo; \
tic -x -o $(XDG_DATA_HOME)/terminfo "/tmp/wezterm.terminfo"; \
fi
rm "/tmp/wezterm.terminfo"
infocmp wezterm | head
discord:
@printf "%s\n" 'Add "SKIP_HOST_UPDATE": true, to ~/.config/discord/settings.json'
@printf "%s\n" 'it has been added to the clipboard'
@echo '"SKIP_HOST_UPDATE": true,' | wl-copy
wow:
@printf "%s\n" "Link to the troubleshooting setup for battle.net on Lutris: https://github.com/lutris/docs/blob/master/Battle.Net.md"
# macos software installed
# hazel
# alfred
# dropbox
#
# Systme settings changed
# hostname
# mouse
#
# rename host and restart
# install xcode tools and check for updates
# github login and keygen
# upload key to github
# do nix
#
# turned off natural scrolling
# turned off rotate
#
# uninstall pages, garage band news etc
# https://www.keka.io/en/
# https://www.appzapper.com/
# https://www.7-zip.org/download.html
# https://www.videolan.org/vlc/
# https://www.hammerspoon.org/
# https://obsidian.md/
# note to exit shell or source the env vars before installing rust and such with nix -- probably easiest to exit
# make sure to sign into icloud and messages
# https://www.busymac.com/busycontacts/
# https://www.publicspace.net/ABetterFinderRename/index.html
# https://marked2app.com/
# https://apphousekitchen.com/
# https://github.com/mhaeuser/Battery-Toolkit/releases
# https://www.lynapp.com/
# https://github.com/p0deje/Maccy/releases
# https://github.com/jordanbaird/Ice/releases/
# https://sindresorhus.com/quickgpt
# Dropbox alternative app: https://maestral.app/
# https://sindresorhus.com/velja
# https://www.mowglii.com/itsycal/
# https://github.com/sbarex/SourceCodeSyntaxHighlight
# https://www.moderncsv.com/
# https://sindresorhus.com/battery-indicator
# https://manytricks.com/witch/
# https://www.popclip.app/
# https://www.stclairsoft.com/DefaultFolderX/
# https://cryptomator.org/
# https://jacklandrin.github.io/macos%20app/2021/12/01/onlyswitch.html
# https://github.com/jordanbaird/Ice/releases
# https://discord.com/download
#
# FOR OTHER:
# https://sindresorhus.com/scratchpad
#
# Setup firefox addons including violentmonkey
# https://www.mozilla.org/en-US/firefox/channel/desktop/#developer
# https://neovide.dev/
# https://www.barebones.com/products/bbedit/
# POSSIBLE USEFULE UTiLITIES fuzzy searching and image resizingpdf and video optimization
# https://lowtechguys.com/cling/
# https://lowtechguys.com/clop/
# https://www.popclip.app/extensions/
# Popclip Extensions:
# DuckDuckGo
# BBEdit
# TextEdit
# Alfred
# Uppercase
# Lowercase
# Slugify
# Obsidian
# https://daisydiskapp.com/
# https://www.publicspace.net/ABetterFinderRename/index.html
#
# Alfred workflows: https://www.packal.org/
#
# APP STORE:
# https://www.gimp.org/downloads/
# https://inkscape.org
# https://github.com/jordanbaird/Ice/releases
# https://skim-app.sourceforge.io/
# https://sqlitebrowser.org/dl/
# #gpicker linux color picker