-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
259 lines (217 loc) · 7.87 KB
/
Makefile
File metadata and controls
259 lines (217 loc) · 7.87 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
#
# Makefile for dotfiles
#
# You can use this Makefile to install individual dotfiles or install all of
# them at once. Each makefile rule first cleans the exisiting dotfile by
# removing it and replacing it with a symlink to the specific file in
# ~/dotfiles.
#
# !!! Make sure you backup your stuff first !!!
#
# make install_irssi expects a FREENODEPASS to replace __irssipassword__ in
# the config. So you should use make install_irssi FREENODEPASS=somepass or
# make all FREENODEPASS=somepass
#
SHELL=/bin/bash
help:
@echo 'Makefile for dotfiles '
@echo ' '
@echo 'Usage: '
@echo ' make all install everything '
@echo ' make install_fonts install custom fonts '
@echo ' make install_bash install bashrc '
@echo ' make install_asdf install asdf '
@echo ' make install_vim install vim files '
@echo ' make install_git_home install git home files '
@echo ' make install_git_work install git work files '
@echo ' make install_taskwarrior installs taskrc '
@echo ' make install_i3 install i3 files '
@echo ' make install_bspwm install bspwm files '
@echo ' make install_python install ipython files '
@echo ' make install_irssi install irssi --irssipassword=X '
@echo ' make install_tmux install tmux conf files '
@echo ' make install_sqlite install sqlite conf files '
@echo ' make install_conky installs conky config '
@echo ' make install_conky_work installs conky work config '
@echo ' make install_psql installs psqlrc '
@echo ' make install_roxterm installs roxterm files '
@echo ' make install_winbox downloads and installs winbox '
@echo ' '
@echo 'All install commands are also available as clean commands to remove '
@echo 'installed files '
@echo ' '
all: install_fonts install_bash install_vim install_git_home install_i3 \
install_irssi install_python install_tmux install_psql
@echo ""
@echo "dotfiles - Making yourself at home"
@echo "=================================="
@echo ""
@echo "All done."
install_fonts: clean_fonts
DEST_FOLDER=~/.local/share/fonts ; \
[ -d $$DEST_FOLDER ] || mkdir -p $$DEST_FOLDER ; \
readarray -t NERD_FONTS < `pwd`/nerd_fonts.lst ; \
for nerd_font in $${NERD_FONTS[@]}; do \
wget $$nerd_font -O $$DEST_FOLDER/font.zip && \
cd $$DEST_FOLDER && unzip -o -q font.zip && \
rm -f ~/.local/share/fonts/font.zip; \
done;
fc-cache -fv
clean_fonts:
rm -Rf ~/.loca/share/fonts
fc-cache -fv
install_bash: clean_bash install_bat
ln -sf `pwd`/bashrc ~/.bashrc
ln -sf `pwd`/bash_aliases ~/.bash_aliases
ln -sf `pwd`/bash_profile ~/.bash_profile
ln -sf `pwd`/inputrc ~/.inputrc
ln -sf `pwd`/bin ~/bin
ln -sf `pwd`/inputrc ~/.inputrc
[ -d ~/.config ] || mkdir ~/.config
ln -sf `pwd`/htop ~/.config/
[ -d terminal-color-theme ] || git clone --recursive https://github.com/sona-tar/terminal-color-theme.git
[ -d fzf ] || git clone --depth 1 https://github.com/junegunn/fzf.git `pwd`/fzf
cd fzf && git pull && ./install --bin
ln -sf `pwd`/fzf/bin/fzf `pwd`/bin
clean_bash:
rm -Rf ~/.inputrc
rm -Rf ~/.bashrc
rm -Rf ~/.bash_aliases
rm -Rf ~/.bash_profile
rm -Rf ~/bin
rm -Rf ~/.inputrc
rm -Rf ~/.config/htop
install_asdf: clean_asdf
ln -sf `pwd`/tool-versions ~/.tool-versions
[ -d ~/.asdf/ ] || \
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.1
cd ~/ && source ~/.asdf/asdf.sh && \
cat ~/.tool-versions | cut -d' ' -f1 | grep "^[^\#]" | xargs -i asdf plugin add {}
cd ~/ && source ~/.asdf/asdf.sh && \
asdf install
clean_asdf:
rm -Rf ~/.tool-versions
rm -Rf ~/.asdf
install_vim: clean_vim
@echo Installing Vim-Plug
curl -fLo `pwd`/vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@echo Place vim config files
ln -sf `pwd`/vimrc ~/.vimrc
ln -sf `pwd`/vim ~/.vim
clean_vim:
rm -Rf ~/.vimrc
rm -Rf ~/.vim
rm -Rf ~/.vimdb
install_nvim: clean_nvim
@echo Installing vundle for neovim
git clone https://github.com/gmarik/Vundle.vim.git `pwd`/nvim/bundle/Vundle.vim
ln -sf `pwd`/nvimrc ~/.nvimrc
ln -sf `pwd`/nvim ~/.nvim
clean_nvim:
rm -Rf ~/.nvimrc
rm -Rf ~/.nvim
install_git_home: clean_git_home
ln -sf `pwd`/gitconfig_home ~/.gitconfig
clean_git_home:
rm -Rf ~/.gitconfig
install_git_work: clean_git_work
ln -sf `pwd`/gitconfig_work ~/.gitconfig
clean_git_work:
rm -Rf ~/.gitconfig
install_i3: clean_i3
ln -sf `pwd`/xinitrc ~/.xinitrc
ln -sf `pwd`/Xresources ~/.Xresources
ln -sf `pwd`/xession ~/.xsession
ln -sf `pwd`/i3 ~/.i3
ln -sf `pwd`/compton.conf ~/.config/compton.conf
clean_i3:
rm -Rf ~/.xinitrc
rm -Rf ~/.xsession
rm -Rf ~/.Xdefaults
rm -Rf ~/.Xresources
rm -Rf ~/.i3
rm -Rf ~/.config/polybar
rm -Rf ~/.config/compton.conf
install_bspwm: clean_bspwm
ln -sf `pwd`/xinitrc ~/.xinitrc
ln -sf `pwd`/Xresources ~/.Xresources
ln -sf `pwd`/xession ~/.xsession
ln -sf `pwd`/bspwm ~/.config/bspwm
ln -sf `pwd`/polybar ~/.config/polybar
ln -sf `pwd`/sxhkd ~/.config/sxhkd
ln -sf `pwd`/compton.conf ~/.config/compton.conf
clean_bspwm:
rm -Rf ~/.xinitrc
rm -Rf ~/.xsession
rm -Rf ~/.Xdefaults
rm -Rf ~/.Xresources
rm -Rf ~/.config/bspwm
rm -Rf ~/.config/polybar
rm -Rf ~/.config/sxhkd
rm -Rf ~/.config/compton.conf
install_irssi:
ifneq "$(IRSSIUSER)" ""
cp `pwd`/irssi ~/.irssi -R
sed -i 's/__irssiuser__/$(IRSSIUSER)/g' ~/.irssi/config
sed -i 's/__irssipass__/$(IRSSIPASS)/g' ~/.irssi/config
else
@echo ""
@echo "Make sure to specific IRSSIUSER=somevalue environment variable."
@echo ""
endif
clean_irssi:
rm -Rf ~/.irssi
install_python: clean_python
ln -sf `pwd`/pylintrc ~/.pylintrc
ln -sf `pwd`/ipython ~/.config/ipython
clean_python:
rm -Rf ~/.pylintrc
rm -Rf ~/.config/ipython
install_tmux: clean_tmux
[ -d ~/.tmux ] || mkdir ~/.tmux
[ -d ~/.tmux/tmux-power ] || git clone https://github.com/wfxr/tmux-power.git ~/.tmux/tmux-power
ln -sf `pwd`/tmux.conf ~/.tmux.conf
[ -d ~/.ssh ] || mkdir ~/.ssh
ln -sf `pwd`/sshrc ~/.ssh/rc
tic `pwd`/tmux18-256color.ti
clean_tmux:
rm -Rf ~/.tmux.conf
rm -Rf ~/.tmux-powerlinerc
rm -Rf ~/.bin/tmux-powerline/themes/my_theme.sh
rm -Rf ~/.bin/tmux-powerline
rm -Rf ~/.ssh/rc
install_sqlite: clean_sqlite
ln -sf `pwd`/sqliterc ~/.sqliterc
clean_sqlite:
rm -Rf ~/.sqliterc
install_conky:
ln -sf `pwd`/conky/conky.conf ~/.conkyrc
clean_conky:
rm -Rf ~/.taskrc
install_taskwarrior:
ln -sf `pwd`/taskrc ~/.taskrc
clean_taskwarrior:
rm -Rf ~/.conkyrc
install_conky_work:
ln -sf `pwd`/conky/conky_work.conf ~/.conkyrc
clean_conky_work:
rm -Rf ~/.conkyrc
install_psql:
ln -sf `pwd`/psqlrc ~/.psqlrc
clean_psql:
rm -Rf ~/.psqlrc
install_roxterm:
ln -sf `pwd`/roxterm ~/.config/roxterm.sourceforge.net
clean_roxterm:
rm -Rf ~/.config/roxterm.sourceforge.net
install_winbox: clean_winbox
@echo 'Installing Winbox 3.27 to /opt/winbox'
[ -d /opt/winbox ] || sudo install -d -o `whoami` /opt/winbox
cd /opt/winbox && wget -O winbox.exe https://mt.lv/winbox64
clean_winbox:
@echo 'Removing Winbox from /opt/winbox/winbox.exe'
if [ -f /opt/winbox/winbox.exe ]; then rm /opt/winbox/winbox.exe; fi
install_bat:
@echo 'Install bat (cat on steroids)'
installers/install_bat.sh