-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
232 lines (174 loc) · 7.79 KB
/
Makefile
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
GROOVY_BANNER=groovy_banner.sh
GROOVY_FUNCTIONS=groovy_functions.sh
GROOVY_VARIABLES=groovy_variables.sh
BANNER_SCRIPT=$(HOME)/$(GROOVY_BANNER)
FUNCTIONS_SCRIPT=$(HOME)/$(GROOVY_FUNCTIONS)
VARIABLES_SCRIPT=$(HOME)/$(GROOVY_VARIABLES)
GROOVY_UNIVERSE=$(BANNER_SCRIPT) $(FUNCTIONS_SCRIPT) $(VARIABLES_SCRIPT)
COMPLETION_FILES=completions
COMPLETION_FILES_INSTALL=$(HOME)/$(COMPLETION_FILES)
SHELL_UNIVERSE=$(GROOVY_UNIVERSE) $(COMPLETION_FILES_INSTALL)
BASH_PROFILE=.bash_profile
BASH_RC=.bashrc
BASH_PROFILE_INSTALL=$(HOME)/$(BASH_PROFILE)
BASH_RC_INSTALL=$(HOME)/$(BASH_RC)
GIT_PROMPT_INSTALL=$(HOME)/.bash/git-aware-prompt
ZSH_RC=.zshrc
ZSH_RC_INSTALL=$(HOME)/$(ZSH_RC)
TMUX_CONF=.tmux.conf
TMUX_CONF_INSTALL=$(HOME)/$(TMUX_CONF)
TPM_DIR=$(HOME)/.tmux/plugins
TPM_DIR_INSTALL=$(HOME)/.tmux/plugins/tpm
VIM_BUNDLE_DIR=$(HOME)/.vim/bundle
VUNDLE_INSTALL=$(VIM_BUNDLE_DIR)/Vundle.vim
VIMRC=.vimrc
VIMRC_INSTALL=$(HOME)/$(VIMRC)
ZATHURARC=zathurarc
ZATHURA_DIR=$(HOME)/.config/zathura
ZATHURARC_INSTALL=$(ZATHURA_DIR)/$(ZATHURARC)
LATEXMKRC=.latexmkrc
LATEXMKRC_INSTALL=$(HOME)/$(LATEXMKRC)
POETRY_FILE=config.toml
POETRY_CONFIG=config/poetry/$(POETRY_FILE)
POETRY_DIR=$(HOME)/.config/pypoetry
POETRY_INSTALL=$(POETRY_DIR)/$(POETRY_FILE)
NEOVIM_CONFIG=config/nvim
NEOVIM_DIR=$(HOME)/.config/nvim
NEOVIM_INSTALL=$(NEOVIM_DIR)
GIT_FLAGS=--quiet
BARE_INSTALL=$(HOME)/.config/autostart/bare.desktop
KEYBOARD_SHORTCUTS_DIR=config/xfce4/xfconf/xfce-perchannel-xml
KEYBOARD_SHORTCUTS_FILE=xfce4-keyboard-shortcuts.xml
KEYBOARD_SHORTCUTS_SRC=$(KEYBOARD_SHORTCUTS_DIR)/$(KEYBOARD_SHORTCUTS_FILE)
KEYBOARD_SHORTCUTS_INSTALL=$(HOME)/.$(KEYBOARD_SHORTCUTS_DIR)/xfce4-keyboard-shortcuts.xml
REDSHIFT_INSTALL_DIR=$(HOME)/.config/reshift
REDSHIFT_FILE=config/redshift/redshift.conf
REDSHIFT_INSTALL_CONFIG=$(HOME)/.$(REDSHIFT_FILE)
help: ##- Show this help
@sed -e '/#\{2\}-/!d; s/\\$$//; s/:[^#\t]*/: /; s/#\{2\}- *//' $(MAKEFILE_LIST)
.PHONY: install_all
install_all: ##- Install all the configurations
install_all: install_bash install_zsh install_tmux install_vim install_zathura install_latexmk install_poetry
.PHONY: install_bash
install_bash: ##- Install Bash configuration
install_bash: $(BASH_PROFILE_INSTALL)
.PHONY: install_zsh
install_zsh: ##- Install ZSH configuration
install_zsh: $(ZSH_RC_INSTALL)
.PHONY: install_tmux
install_tmux: ##- Install tmux configuration and TPM (Tmux Package Manager)
install_tmux: $(TMUX_CONF_INSTALL) $(TPM_DIR_INSTALL)
.PHONY: install_vim
install_vim: ##- Install Vim configuration and Vundle
install_vim: $(VIMRC_INSTALL)
.PHONY: install_zathura
install_zathura: ##- Install Zathura configuration
install_zathura: $(ZATHURARC_INSTALL)
.PHONY: install_latexmk
install_latexmk: ##- Install Latexmk configurartion
install_latexmk: $(LATEXMKRC_INSTALL)
.PHONY: install_poetry
install_poetry: ##- Install Poetry configurartion
install_poetry: $(POETRY_INSTALL)
.PHONY: install_neovim
install_neovim: ##- Install Neovim configurartion
install_neovim: $(NEOVIM_INSTALL)
$(BANNER_SCRIPT): $(GROOVY_BANNER)
@echo 'Installing banner script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Banner script installed.'
$(BASH_PROFILE_INSTALL): $(BASH_PROFILE) $(BASH_RC_INSTALL)
@echo 'Installing .bash_profile script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo '.bash_profile installed.'
$(BASH_RC_INSTALL): $(BASH_RC) $(GIT_PROMPT_INSTALL) $(SHELL_UNIVERSE)
@echo 'Installing .bashrc script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo '.bashrc script installed.' && \
([ -e /etc/profile.d/undistract-me.sh ] || echo 'Install undistract-me.sh to finalize the installation or comment the line using it in your shell configuration file')
$(GIT_PROMPT_INSTALL):
@echo 'Installing Git Aware Prompt for bash...' && \
mkdir -p $(HOME)/.bash && \
git clone $(GIT_FLAGS) https://github.com/jimeh/git-aware-prompt.git $@ && \
echo 'Git Aware Prompt installed.'
$(FUNCTIONS_SCRIPT): $(GROOVY_FUNCTIONS)
@echo 'Installing functions script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Functions script installed.'
$(VARIABLES_SCRIPT): $(GROOVY_VARIABLES)
@echo 'Installing environment variables script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Environment variables script installed.'
$(ZSH_RC_INSTALL): $(ZSH_RC) $(SHELL_UNIVERSE)
@echo 'Installing .zshrc script...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'ZSH configuration installed. Do not forget to install zsh and oh-my-zsh to use this configuration.'
$(COMPLETION_FILES_INSTALL): $(COMPLETION_FILES)
@echo 'Installing shell completion scripts...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Shell completion scripts installed.'
$(TPM_DIR_INSTALL):
@echo 'Installing TPM...' && \
mkdir -p $(TPM_DIR) && \
git clone $(GIT_FLAGS) https://github.com/tmux-plugins/tpm $@ && \
echo 'TPM installed.'
$(TMUX_CONF_INSTALL): $(TMUX_CONF)
@echo 'Installing tmux configuration...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Tmux configuration installed.'
$(VIMRC_INSTALL): $(VIMRC) $(VUNDLE_INSTALL)
@echo 'Installing vim configuration...' && \
ln -sf $(shell pwd)/$< $@ && \
echo "Vim configuration installed. Do not forget to open vim and run :PluginIntall to install plugins and fix errors. You can also run 'vim +PluginInstall +qall' to be quicker. Some softwares such as fzf might need to be installed as well to get some extra features working. See the README.md for details."
$(VUNDLE_INSTALL):
@echo 'Installing Vundle...' && \
mkdir -p $(VIM_BUNDLE_DIR) && \
git clone $(GIT_FLAGS) https://github.com/VundleVim/Vundle.vim.git $@ && \
echo 'Vundle installed.'
$(ZATHURARC_INSTALL): $(ZATHURARC)
@echo 'Installing Zathura configuration...' && \
mkdir -p $(ZATHURA_DIR) && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Zathura configuration installed.'
$(LATEXMKRC_INSTALL): $(LATEXMKRC)
@echo 'Installing Latexmk configuration...' && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Latexmk configuration installed.'
$(POETRY_INSTALL): $(POETRY_CONFIG)
@echo 'Installing Poetry configuration...' && \
mkdir -p $(POETRY_DIR) && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Poetry configuration installed.'
.PHONY:$(NEOVIM_INSTALL)
$(NEOVIM_INSTALL):
@echo 'Installing Neovim configuration...' && \
([ -e '~/.local/share/nvim/site/pack/packer/start/packer.nvim' ] && git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim || echo 0) && \
ln -sf $(shell pwd)/$(NEOVIM_CONFIG) $(NEOVIM_DIR) && \
echo 'Neovim configuration installed.'
install_terminal_theme:
ln -sf $(shell pwd)/.Xresources.gruvbox $(HOME)/.Xresources
install_terminal_font:
([ -e 'Input-Font.zip' ] && curl https://input.djr.com/build/?fontSelection=whole&a=0&g=0&i=0&l=0&zero=0&asterisk=0&braces=0&preset=default&line-height=1.2&accept=I+do&email= -O Input-Font.zip) || echo 0 && \
unzip Input-Font.zip && \
([ -e 'font-patcher' ] && wget https://github.com/ryanoasis/nerd-fonts/raw/master/font-patcher -O font-patcher) || echo 0 && \
python font-patcher --mono Input_Fonts/InputMono/InputMono/InputMono-Regular.ttf
.PHONY: install_bare
install_bare: ##- Install backup reminder desktop autostart
install_bare: $(BARE_INSTALL)
$(BARE_INSTALL):
mkdir -p $(HOME)/.config/autostart
ln -sf $(shell pwd)/config/autostart/bare.desktop $@
.PHONY: install_keyboard_shortcuts
install_keyboard_shortcuts: ##- Install XFCE4 keyboard shortcuts
install_keyboard_shortcuts: $(KEYBOARD_SHORTCUTS_INSTALL)
$(KEYBOARD_SHORTCUTS_INSTALL): $(KEYBOARD_SHORTCUTS_SRC)
mkdir -p $(dir $@) && \
ln -sf $(shell pwd)/$< $@
.PHONY: install_redshift_config
install_redshift_config: ##- Install Redshift configuration
install_redshift_config: $(REDSHIFT_INSTALL_CONFIG)
$(REDSHIFT_INSTALL_CONFIG): $(REDSHIFT_FILE)
@echo 'Installing Redshift configuration' && \
mkdir -p $(REDSHIFT_INSTALL_DIR) && \
ln -sf $(shell pwd)/$< $@ && \
echo 'Redshift configuration installed'