-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
150 lines (134 loc) · 4.61 KB
/
Copy pathMakefile
File metadata and controls
150 lines (134 loc) · 4.61 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
SUBDIRS = awesome qutebrowser vim ncmpcpp beets ranger mutt config/sway
ZSH_CONFIG = \
zsh/zshrc.debian \
zsh/zshrc.env \
zsh/zshrc.local \
zsh/zshrc.fzf \
zsh/zshrc.wine \
zsh/zshrc.wine \
zsh/zshrc.alias
XDG_CONFIG_CONTENT = \
config/nushell/config.nu\
config/nushell/autoload\
config/zathura/zathurarc\
config/mpd/mpd.conf\
config/mpv/input.conf\
config/mpv/mpv.conf\
config/gtk-2.0/settings.ini\
config/gtk-3.0/settings.ini\
config/gtk-4.0/settings.ini\
config/systemd/user/mbsync.timer\
config/systemd/user/mbsync.service\
config/systemd/user/notmuch.service\
config/systemd/user/gpg-agent-mbsync.service\
config/systemd/user/redshift.service.d/override.conf\
config/systemd/user/hyprpaper.service.d/override.conf\
config/systemd/user/conky@.service\
config/systemd/user/conky.target\
config/systemd/user/keynav.service\
config/systemd/user/ipfs.service\
config/environment.d/path.conf\
config/environment.d/xkb.conf\
config/imv/config\
config/mako/config\
config/swayr/config.toml\
config/wofi/style.css\
config/wofi/style.scss\
config/hypr/hyprland.lua\
config/hypr/hyprland.conf\
config/hypr/hyprlock.conf\
config/hypr/hyprpaper.conf\
config/hypr/xdph.conf\
config/hypr/xdph-picker.nu\
$(wildcard config/hypr/config.d/*) \
config/sway/config\
$(wildcard config/sway/config.d/*) \
config/swaylock/config\
config/terminator/config\
config/yazi/init.lua\
config/yazi/yazi.toml\
config/yazi/theme.toml\
config/yazi/keymap.toml\
config/yazi/package.toml\
config/waybar/config.jsonc\
config/waybar/style.css\
config/wayle/config.toml\
config/pipewire/pipewire.conf.d/10-quantum.conf
DOTFILES = gitconfig\
alacritty.toml\
vimrc\
Xresources\
taskrc\
tigrc\
Xmodmap\
gbp.conf\
mbsyncrc\
zshrc\
zplug\
conky\
keynavrc\
fzf_env\
gnupg/gpg-agent.conf\
xkb/symbols/ca-multix-sim590
BIN_FILES = bin/lights\
bin/pinentry-rofi.scm\
bin/setkeyboard\
bin/udev-setkeyboard\
bin/setwallpaper\
bin/wmake\
bin/rofi\
bin/pqutebrowser\
bin/sesame-ouvre-toi\
bin/mako-mode-jeu\
bin/hypr-focus-mode-toggle\
bin/hypr-window-switcher\
bin/hypr-cycle-workspace\
bin/tig
ZSH_DEST_LINKS = $(addprefix $(HOME)/.,$(subst zsh/,,${ZSH_CONFIG}))
XDG_CONFIG_DEST_LINKS = $(addprefix $(HOME)/.,${XDG_CONFIG_CONTENT})
DOTFILES_DEST_LINKS = $(addprefix $(HOME)/.,$(DOTFILES))
BIN_DEST_LINKS = $(addprefix $(HOME)/,$(BIN_FILES))
DEST_LINKS = ${ZSH_DEST_LINKS} \
${XDG_CONFIG_DEST_LINKS} \
${DOTFILES_DEST_LINKS} \
${BIN_DEST_LINKS}
CONFIG_FILES = $(shell git ls-tree --full-tree -r @ | grep -e 'blob.*\.in$$' | gawk '{print $$4}')
CONFIG_OUT = $(CONFIG_FILES:.in=)
.PHONY: all links subdirs clean
all: configure links subdirs
# help: ## Prints help for targets with comments
# @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
configure: $(CONFIG_OUT) ## Configure all the files (strings substitutions)
$(CONFIG_OUT): $(CONFIG_FILES)
m4 macros.m4 $(foreach def,$(M4_DEFINE),-D$(def)) $@.in > $@
chmod $(if $(findstring bin/,$@),755,644) $@
links: dirs $(DEST_LINKS) ## Produce all symlinks on system
dirs:
mkdir -p $(dir $(DEST_LINKS))
define MAKE_LINKS
$(1): $(2)
ln -s $$(CURDIR)/$$< $$@ ; true
endef
$(eval $(call MAKE_LINKS,$(HOME)/.%, %))
$(eval $(call MAKE_LINKS,$(HOME)/.%, zsh/%))
$(eval $(call MAKE_LINKS,$(HOME)/bin/%, bin/%))
$(HOME)/.oh-my-zsh:
rm -rf ~/.oh-my-zsh
sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --unattended"
echo "source $$HOME/.zshrc.local" >> $$HOME/.zshrc
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $${ZSH_CUSTOM:-$(HOME)/.oh-my-zsh/custom}/themes/powerlevel10k
@echo "Theme powerlevel10k has been installed. It needs to be enabled and configured. See ZSH_THEME variable in ~/.zshrc..."
zshrc: $(HOME)/.oh-my-zsh
subdirs:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir; \
done
clean-config: ## Clean configured files (result of m4 processing)
rm -f $(CONFIG_OUT)
clean-links: ## Clean links on the system
rm -ir $(DEST_LINKS) ; true
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done
clean: clean-links clean-config ## Clean all
# vim:set noet sts=0 sw=2 ts=2 tw=80: