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