-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
182 lines (135 loc) · 5.04 KB
/
Copy pathMakefile
File metadata and controls
182 lines (135 loc) · 5.04 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
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 cmux ghostty yabai skhd sketchybar claude codex
# 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: | $(HOME)/.claude $(HOME)/.claude/hooks
@$(LINK_CMD) SRC='claude/statusline.sh' DEST='$(HOME)/.claude/statusline.sh'
@$(LINK_CMD) SRC='claude/hooks.sh' DEST='$(HOME)/.claude/hooks.sh'
@chmod a+x $(CURDIR)/claude/hooks/create-worktree.sh
@chmod a+x $(CURDIR)/claude/hooks/remove-worktree.sh
@$(LINK_CMD) SRC='claude/hooks/create-worktree.sh' DEST='$(HOME)/.claude/hooks/create-worktree.sh'
@$(LINK_CMD) SRC='claude/hooks/remove-worktree.sh' DEST='$(HOME)/.claude/hooks/remove-worktree.sh'
@chmod a+x $(CURDIR)/claude/build-settings.sh
@$(CURDIR)/claude/build-settings.sh
$(HOME)/.claude:
@$(CREATE_TARGET_DIR)
$(HOME)/.claude/hooks:
@$(CREATE_TARGET_DIR)
# codex
.PHONY: codex
codex: | $(HOME)/.codex $(HOME)/.local/bin
@chmod a+x $(CURDIR)/codex/notify.sh
@$(LINK_CMD) SRC='codex/notify.sh' DEST='$(HOME)/.codex/notify.sh'
@chmod a+x $(CURDIR)/codex/create-worktree.sh
@chmod a+x $(CURDIR)/codex/remove-worktree.sh
@chmod a+x $(CURDIR)/codex/codex-worktree.sh
@chmod a+x $(CURDIR)/codex/codex-worktree-rm.sh
@$(LINK_CMD) SRC='codex/codex-worktree.sh' DEST='$(HOME)/.local/bin/codex-worktree'
@$(LINK_CMD) SRC='codex/codex-worktree-rm.sh' DEST='$(HOME)/.local/bin/codex-worktree-rm'
@chmod a+x $(CURDIR)/codex/build-config.sh
@$(CURDIR)/codex/build-config.sh
$(HOME)/.codex:
@$(CREATE_TARGET_DIR)
$(HOME)/.local/bin:
@$(CREATE_TARGET_DIR)
.PHONY: codex-diff
codex-diff:
@chmod a+x $(CURDIR)/codex/diff-config.sh
@$(CURDIR)/codex/diff-config.sh
.PHONY: claude-diff
claude-diff:
@chmod a+x $(CURDIR)/claude/diff-settings.sh
@$(CURDIR)/claude/diff-settings.sh
FORCE:
.PHONY: FORCE clean