]> git.rmz.io Git - dotfiles.git/blob - Makefile
df4c443e41a1ad61665fef0a427a496955563e0e
[dotfiles.git] / Makefile
1 APATH := $(realpath .)
2
3 FILES := bin
4 DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources
5 CONFIGFILES := compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb
6
7 .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
8 install: $(FILES) $(DOTFILES) $(CONFIGFILES)
9
10 ~/.config:
11 mkdir -p ~/.config
12
13 vim: ~/.config
14 ln -sfT $(APATH)/vim ~/.config/vim
15 mkdir -p ~/.local/share/vim
16 git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle
17 .PHONY: vim
18
19 mutt: ~/.config
20 ln -sfT $(APATH)/mutt ~/.config/mutt
21 .PHONY: mutt
22
23 gdb:
24 ln -sfT $(APATH)/gdbinit ~/.gdbinit
25 ln -sfT $(APATH)/cgdb ~/.cgdb
26 .PHONY: gdb
27
28 awesome: ~/.config
29 ln -sfT $(APATH)/awesome ~/.config/awesome
30 .PHONY: awesome
31
32 qutebrowser: ~/.config
33 ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser
34 mkdir -p ~/downloads
35 .PHONY: qutebrowser
36
37 mpd: systemd
38 ln -sfT $(APATH)/mpd ~/.config/mpd
39 mkdir -p ~/.local/share/mpd/playlists
40 systemctl --user enable mpd
41 systemctl --user start mpd
42 .PHONY: mpd
43
44 ncmpcpp: ~/.config
45 ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
46 mkdir -p ~/.local/share/mpd/lyrics
47 .PHONY: ncmpcpp
48
49 systemd: ~/.config
50 ln -sfT $(APATH)/$@ ~/.config/$@
51 .PHONY: systemd
52
53 gnupg: systemd
54 ln -sfT $(APATH)/$@ ~/.config/$@
55 systemctl --user enable gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
56 systemctl --user start gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
57 .PHONY: gnupg
58
59 zsh: ~/.config
60 ln -sfT $(APATH)/zshrc ~/.zshrc
61 ln -sfT $(APATH)/zprofile ~/.zprofile
62 ln -sfT $(APATH)/zshenv ~/.zshenv
63 ln -sfT $(APATH)/zsh ~/.config/zsh
64 ln -sfT $(APATH)/aliases ~/.config/aliases
65 mkdir -p ~/.cache/zsh
66 .PHONY: zsh
67
68 xprofile:
69 ln -sfT $(APATH)/xprofile ~/.xprofile
70 .PHONY: xprofile
71
72 dircolors: ~/.config
73 ln -sfT $(APATH)/dircolors ~/.config/dircolors
74 .PHONY: dircolors
75
76 urxvt: ~/.config
77 ln -sfT $(APATH)/urxvt ~/.config/urxvt
78 .PHONY: urxvt
79
80 $(FILES):
81 @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
82 if [[ -d $@ ]]; then \
83 cp -r ~/$@/* $@; \
84 else \
85 cp -r ~/$@ $@; \
86 fi; \
87 rm -r ~/$@; \
88 fi;
89 ln -sfT $(APATH)/$@ ~/$@
90
91 $(DOTFILES):
92 @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
93 if [[ -d .$@ ]]; then \
94 cp -r ~/.$@/* $@; \
95 else \
96 cp -r ~/.$@ $@; \
97 fi; \
98 rm -r ~/.$@; \
99 fi;
100 ln -sfT $(APATH)/$@ ~/.$@
101
102 $(CONFIGFILES): ~/.config
103 @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
104 if [[ -d .config/$@ ]]; then \
105 cp -r ~/.config/$@/* $@; \
106 else \
107 cp -r ~/.config/$@ $@; \
108 fi; \
109 rm -r ~/.config/$@; \
110 fi;
111 ln -sfT $(APATH)/$@ ~/.config/$@