-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
367 lines (297 loc) Β· 12.6 KB
/
Makefile
File metadata and controls
367 lines (297 loc) Β· 12.6 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
# References
# https://github.com/webpro/dotfiles/blob/master/Makefile
# https://xs-labs.com/en/blog/2020/11/07/introduction-to-makefiles/
# Warning:
# Do not use`rm -rf path/to/dir/` for symlinks applied to directories.
# To remove the dir symlink, only use `rm path/to/dir_symlink` w/o last dash.
# Then you will remove only the symlink on the disk.
# Warning:
# To symlink the dir in macOS (the right way), you need to use `-n` .
# -n flag treats the destination as file, even if it is a dir.
# Warning:
# To suppress errors and skip the command when it fails (returns non-zero exit code):
# Use `-` before a command to ignore errors and continue with next one.
# Use `|| true` in the end of the command to suppress the error.
help:
@cat Makefile
install-brew:
brew bundle install --file=Brewfile
# https://github.com/emacs-mirror/emacs
# EMACS CONFIGURATION
EMACS_SOURCE := $(CURDIR)/configs/emacs
EMACS_DEST := $(HOME)/.config/emacs
install-emacs-conf: uninstall-emacs-conf
@if [ ! -d "$(EMACS_DEST)" ]; then echo "β ~/.config/emacs dir does not exist. Exit."; exit 1; fi
@echo "\nInstalling Emacs configuration π"
ln -s -f $(EMACS_SOURCE)/init.el $(EMACS_DEST)/init.el
ln -s -f $(EMACS_SOURCE)/custom.init.el $(EMACS_DEST)/custom.init.el
uninstall-emacs-conf:
rm $(EMACS_DEST)/init.el || true
rm $(EMACS_DEST)/custom.init.el || true
## Batch mode - test if config loads without errors.
emacs-lint:
emacs --batch -l configs/emacs/init.el
## mas
### π¦ Mac App Store command line interface
mas-list-apps:
@echo "Here is the list of all macOS apps installed via App Store:"
mas list
mas-install-bear:
@echo "Bear, beautiful, powerfully simple Markdown app to capture, write, and organize your life."
mas install 1091189122
mas-install-pdf:
@echo "PDF Viewer Pro by PSPDFKit"
mas install 1120099014
## Install Configuration Files
# WARNING! The whole setup is macOS-oriented, no plans to suuport Linux currenlty.
install-all:
$(MAKE) install-emacs-conf
$(MAKE) install-finicky-conf
$(MAKE) install-fish-conf
$(MAKE) install-git-conf
#$(MAKE) install-gpg-conf
$(MAKE) install-karabiner-conf
$(MAKE) install-nvim-conf
$(MAKE) install-shell-conf
$(MAKE) install-ssh-conf
$(MAKE) install-tmux-conf
$(MAKE) install-vim-conf
$(MAKE) install-vscode-conf
$(MAKE) install-zed-conf
$(MAKE) install-zellij-conf
$(MAKE) install-zsh-conf
uninstall-all:
$(MAKE) uninstall-emacs-conf
$(MAKE) uninstall-finicky-conf
$(MAKE) uninstall-fish-conf
$(MAKE) uninstall-git-conf
#$(MAKE) uninstall-gpg-conf
$(MAKE) uninstall-karabiner-conf
$(MAKE) uninstall-nvim-conf
$(MAKE) uninstall-shell-conf
$(MAKE) uninstall-ssh-conf
$(MAKE) uninstall-tmux-conf
$(MAKE) uninstall-vim-conf
$(MAKE) uninstall-vscode-conf
$(MAKE) uninstall-zed-conf
$(MAKE) uninstall-zellij-conf
$(MAKE) uninstall-zsh-conf
# https://github.com/johnste/finicky
# A macOS app for customizing which browser to start
FINICKY_SOURCE := $(CURDIR)/configs/finicky
FINICKY_DEST := $(HOME)
install-finicky-conf: uninstall-finicky-conf
@echo "\nInstalling finicky configuration π"
ln -s -f $(FINICKY_SOURCE)/finicky.js $(FINICKY_DEST)/.finicky.js
uninstall-finicky-conf:
rm ~/.finicky.js || true
# https://github.com/fish-shell/fish-shell
# FISH SHELL CONFIGURATION
#TODO(fish): fix up make error log isses:
#make: fisher: No such file or directory
#make: *** [install-fish-plugins] Error 1
install-fish-plugins:
@echo "\nPreparing fish plugin manager before installing plugins..."
brew list fisher || HOMEBREW_NO_AUTO_UPDATE=1 brew install fisher
@echo "TBD parse ~/.config/fish/fish_plugins file, putting all plugins in a line, and provide as arg to the `fisher install <arg>`"
fisher install edc/bass
#fisher install ilancosman/tide@v6
fisher install jorgebucaran/nvm.fish
fisher install sentriz/fish-pipenv
FISH_SOURCE := $(CURDIR)/configs/fish
FISH_DEST := $(HOME)/.config/fish
install-fish-conf: uninstall-fish-conf
@if [ ! -d "$(FISH_DEST)" ]; then echo "β ~/.config/fish dir does not exist. Exit"; exit 1; fi
@echo "\nInstalling fish shell configuration π"
ln -s -f $(FISH_SOURCE)/config.fish $(FISH_DEST)/config.fish
ln -s -f $(FISH_SOURCE)/fish_plugins $(FISH_DEST)/fish_plugins
ln -s -f $(FISH_SOURCE)/functions/fish_prompt.fish $(FISH_DEST)/functions/fish_prompt.fish
@if [ ! -d "$(FISH_DEST)/conf.d" ]; then echo "~/.config/fish/conf.d dir does not exist. Exit"; exit 1; fi
ln -s -f $(FISH_SOURCE)/conf.d/fnm.fish $(FISH_DEST)/conf.d/fnm.fish
uninstall-fish-conf:
rm $(FISH_DEST)/config.fish || true
rm $(FISH_DEST)/fish_plugins || true
rm $(FISH_DEST)/functions/fish_prompt.fish || true
# https://github.com/git/git
# git configuration
GIT_SOURCE := $(CURDIR)/configs/git
GIT_DEST := $(HOME)
install-git-conf: uninstall-git-conf
@echo "\nInstalling git configuration π"
ln -s -f $(GIT_SOURCE)/gitattributes $(GIT_DEST)/.gitattributes
ln -s -f $(GIT_SOURCE)/gitconfig $(GIT_DEST)/.gitconfig
ln -s -f $(GIT_SOURCE)/gitconfig.work $(GIT_DEST)/.gitconfig.work
ln -s -f $(GIT_SOURCE)/gitignore_global $(GIT_DEST)/.gitignore_global
uninstall-git-conf:
rm ~/.gitattributes || true
rm ~/.gitconfig || true
rm ~/.gitconfig.work || true
rm ~/.gitignore_global || true
# https://github.com/gpg/gnupg
# gnupg configuration
GNUPG_SOURCE := $(CURDIR)/configs/gnupg
GNUPG_DEST := $(HOME)/.gnupg
install-gpg-conf: uninstall-gpg-conf
@echo "GPG public key(ring) is not used at the moment. Exit."
brew list gnupg || HOMEBREW_NO_AUTO_UPDATE=1 brew install gnupg
@echo "\nInstalling GnuPG (gpg) configuration π"
ln -s -f $(GNUPG_SOURCE)/common.conf $(GNUPG_DEST)/common.conf
# ln -s -f $(GNUPG_SOURCE)/gpg.conf $(GNUPG_DEST)/gpg.conf
# ln -s -f $(GNUPG_SOURCE)/gpg-agent.conf $(GNUPG_DEST)/gpg-agent.conf
uninstall-gpg-conf:
rm -f $(GNUPG_DEST)/common.conf
#rm -f $(GNUPG_DEST)/gpg.conf
#rm -f $(GNUPG_DEST)/gpg-agent.conf
# https://github.com/pqrs-org/Karabiner-Elements
# karabiner configuration (Keyboard customiser)
KARABINER_SOURCE := $(CURDIR)/configs/karabiner
KARABINER_DEST := $(HOME)/.config/karabiner
install-karabiner-conf: uninstall-karabiner-conf
@echo "\nInstalling Karabiner configuration π"
ln -s -f $(KARABINER_SOURCE)/karabiner.json $(KARABINER_DEST)/karabiner.json
ln -s -f $(KARABINER_SOURCE)/change-lang-one-key.json $(KARABINER_DEST)/assets/complex_modifications/change-lang-one-key.json
uninstall-karabiner-conf:
rm $(KARABINER_DEST)/karabiner.json || true
rm $(KARABINER_DEST)/assets/complex_modifications/change-lang-one-key.json || true
# https://github.com/neovim/neovim
# NEOVIM CONFIGURATION
NVIM_SOURCE := $(CURDIR)/configs/nvim
NVIM_DEST := $(HOME)/.config/nvim
install-nvim-conf: uninstall-nvim-conf
@if [ ! -d "$(NVIM_DEST)" ]; then echo "β ~/.config/nvim dir does not exist. Exit."; exit 1; fi
@echo "\nInstalling NeoVim configuration π"
ln -s -f $(NVIM_SOURCE)/init.lua $(NVIM_DEST)/init.lua
ln -s -n $(NVIM_SOURCE)/lua $(NVIM_DEST)/lua
uninstall-nvim-conf:
rm $(NVIM_DEST)/init.lua || true
rm $(NVIM_DEST)/lua || true
# https://github.com/gitGNU/gnu_bash
# SHELL CONFIGURATION (bash-driven)
SHELL_SOURCE := $(CURDIR)/configs/shell
SHELL_DEST := $(HOME)
install-shell-conf: uninstall-shell-conf
@echo "\nInstalling bash & shell config files π"
echo "$(SHELL_SOURCE)/aliases link to $(SHELL_DEST)/.aliases"
ln -s -f $(SHELL_SOURCE)/aliases $(SHELL_DEST)/.aliases
ln -s -f $(SHELL_SOURCE)/bashrc $(SHELL_DEST)/.bashrc
ln -s -f $(SHELL_SOURCE)/profile $(SHELL_DEST)/.profile
uninstall-shell-conf:
rm ~/.aliases || true
rm ~/.bashrc || true
rm ~/.profile || true
# https://github.com/openssh/openssh-portable
# SSH CONFIGURATION
SSH_SOURCE := $(CURDIR)/configs/ssh
SSH_DEST := $(HOME)/.ssh
install-ssh-conf: uninstall-ssh-conf
@echo "\nInstalling SSH configuration π"
ln -s -f $(SSH_SOURCE)/config $(SSH_DEST)/config
@echo "\nChecking out SSH private keys for the 'ssh-agent:"
ssh-add -l
uninstall-ssh-conf:
rm ~/.ssh/config || true
## Sublime Text 4 configs
SUBLIME_TEXT_DOTFILES_CONF_DIR := $(CURDIR)/configs/sublime-text
SUBLIME_TEXT_CONF_DIR := "$(HOME)/Library/Application\ Support/Sublime\ Text/Packages/User"
install-sublime-text-conf:
@$(MAKE) uninstall-sublime-text-conf
@echo "\n⨠Installing Sublime Text 4 config files."
@if [ ! -d "$(SUBLIME_TEXT_CONF_DIR)" ]; then echo "β Sublime Text 4 is not installed"; exit -1; fi
ln -s -n "$(SUBLIME_TEXT_DOTFILES_CONF_DIR)/Default (OSX).sublime-keymap" "$(SUBLIME_TEXT_CONF_DIR)/Default (OSX).sublime-keymap"
ln -s -n "$(SUBLIME_TEXT_DOTFILES_CONF_DIR)/Package Control.sublime-settings" "$(SUBLIME_TEXT_CONF_DIR)/Package Control.sublime-settings"
ln -s -n "$(SUBLIME_TEXT_DOTFILES_CONF_DIR)/Preferences.sublime-settings" "$(SUBLIME_TEXT_CONF_DIR)/Preferences.sublime-settings"
uninstall-sublime-text-conf:
rm "$(SUBLIME_TEXT_CONF_DIR)/Default (OSX).sublime-keymap" || true
rm "$(SUBLIME_TEXT_CONF_DIR)/Package Control.sublime-settings" || true
rm "$(SUBLIME_TEXT_CONF_DIR)/Preferences.sublime-settings" || true
# https://github.com/tmux/tmux
# TMUX CONFIGURATION (Terminal multiplexer)
TMUX_SOURCE := $(CURDIR)/configs/tmux
TMUX_DEST := $(HOME)/.config/tmux
install-tmux-conf: uninstall-tmux-conf
@echo "\nInstalling tmux configuration π"
mkdir -p $(TMUX_DEST)
ln -s -f $(TMUX_SOURCE)/tmux.conf $(TMUX_DEST)/tmux.conf
uninstall-tmux-conf:
rm $(TMUX_DEST)/tmux.conf || true
# https://github.com/vim/vim
# VIM CONFIGURATION
VIM_SOURCE := $(CURDIR)/configs/vim
VIM_DEST := $(HOME)/.vim
install-vim-conf: uninstall-vim-conf
@if [ ! -d "$(VIM_DEST)" ]; then echo "β ~/.vim dir does not exist. Exit."; exit 1; fi
@echo "\nInstalling Vim configuration π"
ln -s -f $(VIM_SOURCE)/vimrc $(VIM_DEST)/.vimrc
uninstall-vim-conf:
rm $(VIM_DEST)/.vimrc || true
# https://github.com/microsoft/vscode
# VSCODE CONFIGURATION
VSCODE_SOURCE := $(CURDIR)/configs/vscode
VSCODE_DEST := $(HOME)/Library/Application\ Support/Code/User
install-vscode-conf: uninstall-vscode-conf
@if [ ! -d $(VSCODE_DEST) ]; then echo "β VSCode is not installed. Exit."; exit 1; fi
@echo "\nInstalling VSCode configuration π"
ln -s -f $(VSCODE_SOURCE)/keybindings.json $(VSCODE_DEST)/keybindings.json
ln -s -f $(VSCODE_SOURCE)/settings.json $(VSCODE_DEST)/settings.json
uninstall-vscode-conf:
rm $(VSCODE_DEST)/keybindings.json || true
rm $(VSCODE_DEST)/settings.json || true
## Xcode keybindings
XCODE_DIR := $(CURDIR)/configs/xcode
XCODE_KEYBINDINGS_DESTINATION := $(HOME)/Library/Developer/Xcode/UserData/KeyBindings
install-xcode-keybinds:
@$(MAKE) uninstall-xcode-keybinds
@echo "\nInstalling Xcode custom key bindings π"
mkdir -p $(XCODE_KEYBINDINGS_DESTINATION)
ln -s -n $(XCODE_DIR)/custom.idekeybindings $(XCODE_KEYBINDINGS_DESTINATION)/custom.idekeybindings
uninstall-xcode-keybinds:
rm $(XCODE_KEYBINDINGS_DESTINATION)/custom.idekeybindings || true
# https://github.com/zed-industries/zed
# ZED EDITOR CONFIGURATION
ZED_SOURCE := $(CURDIR)/configs/zed
ZED_DEST := $(HOME)/.config/zed
install-zed-conf: uninstall-zed-conf
@if [ ! -d $(ZED_DEST) ]; then echo "β ~/.config/zed dir does not exist. Exit."; exit 1; fi
@echo "\nInstalling Zed editor configuration π"
ln -s -f $(ZED_SOURCE)/settings.json $(ZED_DEST)/settings.json
ln -s -f $(ZED_SOURCE)/keymap.json $(ZED_DEST)/keymap.json
uninstall-zed-conf:
rm $(ZED_DEST)/settings.json || true
rm $(ZED_DEST)/keymap.json || true
# https://github.com/zellij-org/zellij
# ZELLIJ CONFIGURATION (Pluggable terminal workspace)
ZELLIJ_SOURCE := $(CURDIR)/configs/zellij
ZELLIJ_DEST := $(HOME)/.config/zellij
install-zellij-conf: uninstall-zellij-conf
@if [ ! -d "$(ZELLIJ_DEST)" ]; then echo "β ~/.config/zellij dir does not exist. Exit."; exit 1; fi
@echo "\nInstalling zellij configuration π"
ln -s -f $(ZELLIJ_SOURCE)/config.kdl $(ZELLIJ_DEST)/config.kdl
uninstall-zellij-conf:
rm $(ZELLIJ_DEST)/config.kdl || true
doc-zellij:
@echo "There are 2 config files available, config.kdl and default.config.kdl in the repo."
@echo "The config.default.kdl is generated by zellij if there is no config files in the ~/.config/zellij dir by-default."
# https://github.com/zsh-users/zsh
# ZSH CONFIGURATION
ZSH_SOURCE := $(CURDIR)/configs/zsh
ZSH_DEST := $(HOME)
install-zsh-conf: uninstall-zsh-conf
@echo "\nInstalling Zsh configuration π"
ln -s -f $(ZSH_SOURCE)/zshenv $(ZSH_DEST)/.zshenv
ln -s -f $(ZSH_SOURCE)/zshrc $(ZSH_DEST)/.zshrc
uninstall-zsh-conf:
rm $(ZSH_DEST)/.zshenv || true
rm $(ZSH_DEST)/.zshrc || true
# Misc Targets:
colorcheck:
pastel colorcheck
.PHONY: colorcheck
vscode-install-extensions:
./bin/vscode/vscode-extensions-install
.PHONY: vscode-install-extensions
vscode-export-extension-list:
./bin/vscode/vscode-extensions-list-export
.PHONY: export-vscode-extension-list
terminal-macos-doc:
@echo "Use Atom.terminal theme in the Termainl.app -> Settings -> Profiles -> More -> Import..."
.PHONY: terminal-macos-doc