-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
141 lines (101 loc) · 3.68 KB
/
Makefile
File metadata and controls
141 lines (101 loc) · 3.68 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
MAKE = make -s
LINK_CMD = $(MAKE) link SRC=$<
LINK_CONFIG = $(MAKE) link-config SRC=$<
CREATE_DIR = [ -d $$DIR_PATH ] || (mkdir -p $$DIR_PATH && echo "Created directory. ( $$DIR_PATH )")
CREATE_TARGET_DIR = [ -d $@ ] || (mkdir -p $@ && echo "Created directory. ( $@ )")
include ./xdg_config.mk
common: ctags ranger zsh mise wezterm
linux: common polybar rofi mpv feh sxiv i3 urxvt
mac: common yabai skhd sketchybar
# ctags
.PHONY: ctags
ctags: $(HOME)/.ctags $(HOME)/.ctags.d/conf.ctags
$(HOME)/.ctags:
@$(LINK_CMD) SRC='ctags/.ctags' DEST='$(HOME)/.ctags'
$(HOME)/.ctags.d/conf.ctags: | $(HOME)/.ctags.d
@$(LINK_CMD) SRC='ctags/.ctags' DEST='$(HOME)/.ctags.d/conf.ctags'
$(HOME)/.ctags.d:
@$(CREATE_TARGET_DIR)
# polybar
.PHONY: polybar
polybar: /usr/local/bin/polybar-run $(XDG_CONFIG_HOME)/polybar/config polybar/config
polybar: /usr/local/bin/pulseaudio-rofi $(XDG_CONFIG_HOME)/polybar/uvcvideo.sh
polybar/config:
polybar/pulseaudio-rofi.sh:
curl -L https://github.com/deresmos/polybar-scripts/raw/master/polybar-scripts/pulseaudio-rofi/pulseaudio-rofi.sh -o polybar/pulseaudio-rofi.sh \
&& chmod a+x polybar/pulseaudio-rofi.sh
/usr/local/bin/pulseaudio-rofi: polybar/pulseaudio-rofi.sh
sudo ln -sf $(CURDIR)/polybar/pulseaudio-rofi.sh /usr/local/bin/pulseaudio-rofi
/usr/local/bin/polybar-run:
sudo ln -sf $(CURDIR)/polybar/polybar-run.sh /usr/local/bin/polybar-run
$(XDG_CONFIG_HOME)/polybar/uvcvideo.sh: | $(XDG_CONFIG_HOME)/polybar
@$(LINK_CONFIG) SRC='polybar/uvcvideo.sh'
$(XDG_CONFIG_HOME)/polybar/config: polybar/config | $(XDG_CONFIG_HOME)/polybar
@$(LINK_CONFIG) SRC='polybar/config'
polybar/config: polybar/make-polybar-config.py
cd polybar && python make-polybar-config.py
$(XDG_CONFIG_HOME)/polybar:
@$(CREATE_TARGET_DIR)
# feh
.PHONY: feh
feh: $(XDG_CONFIG_HOME)/feh/keys
$(XDG_CONFIG_HOME)/feh/keys: | $(XDG_CONFIG_HOME)/feh
@$(LINK_CONFIG) SRC='feh/keys'
$(XDG_CONFIG_HOME)/feh:
@$(CREATE_TARGET_DIR)
# sxiv
.PHONY: sxiv
sxiv: $(XDG_CONFIG_HOME)/sxiv/exec/key-handler $(XDG_CONFIG_HOME)/sxiv/exec/image-info
sxiv: /usr/local/bin/sxiv-target
$(XDG_CONFIG_HOME)/sxiv/exec/key-handler: sxiv/exec/key-handler | $(XDG_CONFIG_HOME)/sxiv/exec
@$(LINK_CONFIG)
$(XDG_CONFIG_HOME)/sxiv/exec/image-info: sxiv/exec/image-info | $(XDG_CONFIG_HOME)/sxiv/exec
@$(LINK_CONFIG)
/usr/local/bin/sxiv-target: sxiv/sxiv-target.sh
sudo ln -sf $(CURDIR)/sxiv/sxiv-target.sh $@
$(XDG_CONFIG_HOME)/sxiv/exec:
@$(CREATE_TARGET_DIR)
/usr/local/bin/sxiv: | sxiv-code
cd sxiv-code && make && sudo make install
sxiv-code:
git clone https://github.com/deresmos/sxiv sxiv-code
clean:
sudo rm /usr/local/bin/sxiv
rm -rf sxiv-code
# zsh
.PHONY: zsh
zsh: $(HOME)/.zshrc
$(HOME)/.zshrc:
@$(LINK_CMD) SRC='zsh/.zshrc' DEST='$(HOME)/.zshrc'
# i3
.PHONY: i3
i3: $(HOME)/.i3/config
$(HOME)/.i3/config: i3/config | $(HOME)/.i3
@$(LINK_CMD) SRC='i3/config' DEST='$(HOME)/.i3/config'
$(HOME)/.i3:
@$(CREATE_TARGET_DIR)
# urxvt
.PHONY: urxvt
urxvt: $(HOME)/.Xresources
$(HOME)/.Xresources: urxvt/.Xresources
@$(LINK_CMD) SRC='urxvt/.Xresources' DEST='$(HOME)/.Xresources'
# utils
link: FORCE
@[ -z $(SRC) ] || (SRC_PATH=$(CURDIR)/$(SRC) && \
DEST_PATH=$(DEST) && \
ln -sf $$SRC_PATH $$DEST_PATH && \
echo 'Created symbolic link:' $$SRC_PATH '==>' $$DEST_PATH)
link-config: FORCE
make -s link SRC=$(SRC) DEST=$(XDG_CONFIG_HOME)/$(SRC)
# wezterm
.PHONY: wezterm
wezterm:
@$(LINK_CMD) SRC='wezterm/.wezterm.lua' DEST='$(HOME)/.wezterm.lua'
# claude
.PHONY: claude
claude:
@$(LINK_CMD) SRC='claude/settings.json' DEST='$(HOME)/.claude/settings.json'
@$(LINK_CMD) SRC='claude/statusline.sh' DEST='$(HOME)/.claude/statusline.sh'
@$(LINK_CMD) SRC='claude/hooks.sh' DEST='$(HOME)/.claude/hooks.sh'
FORCE:
.PHONY: FORCE clean