-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
160 lines (127 loc) · 4.19 KB
/
Makefile
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
# This Makefile manages dotfiles using `stow` and also has helpers for
# bootstrapping a new system with packages I use the most.
#
# See the README.md for more information about how symlinks are built.
ALL_PACKAGES := \
emacs \
xmonad \
bash \
gnupg \
postgresql \
ssh \
x11 \
ghc \
git \
fonts \
stack \
bin \
global \
systemd
PACKAGES := $(or $(pkg),$(ALL_PACKAGES))
# The location you want to install packages to
PKG_DIR ?= $(or $(target),$(HOME))
THEME ?= $(or $(theme),mocha-256)
THEME_DIR := docs/assets/base16-xresources/xresources
XMONAD := $(HOME)/.xmonad/xmonad-x86_64-linux
XMOBAR_BIN := $(HOME)/.local/bin/xmobar
XMONAD_BIN := $(HOME)/.local/bin/xmonad
STOW_FLAGS := --verbose -v1 --target=$(PKG_DIR)
STOW_FLAGS += --ignore="gnupg/.gnupg/.*.gpg" \
--ignore=".*.pem" \
--ignore=".*TAGS" \
--ignore="flycheck_.*" \
--ignore=".*.rej" \
--ignore=".*.swp" \
--ignore=".*~" \
--ignore="dotlocal/"
.PHONY: simulate
simulate: submodules
@stow $(STOW_FLAGS) --simulate $(PACKAGES)
-@[ -d "./dotlocal" ] && make -C dotlocal/ simulate
.PHONY: dotfiles
dotfiles: submodules
@stow $(STOW_FLAGS) --no-folding -v1 --target=$(PKG_DIR) $(PACKAGES)
-@[ -d "./dotlocal" ] && make -C dotlocal/ dotfiles
.PHONY: clean
clean:
@stow $(STOW_FLAGS) -D $(PACKAGES)
# https://brianbuccola.com/how-to-install-xmonad-and-xmobar-via-stack/
.PHONY: xmonad $(XMONAD)
xmonad: $(XMONAD)
$(XMONAD): xmonad/.xmonad/xmonad.hs $(XMONAD_BIN) $(XMOBAR_BIN)
$(shell stack path --local-bin)/xmonad --recompile
$(shell stack path --local-bin)/xmonad --restart
$(XMONAD_BIN): stack/.stack/global-project/stack.yaml stack/.stack/config.yaml
cd $(PWD) && stack install xmonad xmonad-contrib
# flags for xmobar are configured in ~/.stack/global-project/stack.yaml
$(XMOBAR_BIN): stack/.stack/global-project/stack.yaml stack/.stack/config.yaml
cd $(PWD) && stack install xmobar
# New base16 themes: https://github.com/chriskempson/base16
theme: submodules
@# The .Xresources.d/theme script is sourced in the `.Xresources` file.
@cat $(THEME_DIR)/base16-$(THEME).Xresources > x11/.Xresources.d/theme
@# clears all xresources
@xrdb -remove
@# The default
@# `startx` using `.xsession` will use my Xresources file as long as it\'s allowed
@# in `/etc/X11/xsession.options`. See `man xsession` & `man xsession.options` for
@# more info.
@#
@# Technically, the override shouldn\'t be needed but it\'s possible that in the
@# future some system "default" xsession scripts initialize resources that conflict
@# with my colors. So, override.
@xrdb -merge -override ~/.Xresources
@-xrdb -query | grep -v '^$$'
@# TODO
@#dunst_xr_theme_changer.sh
@#mv ~/.config/dunst/dunstrc_xr_colors x11/.config/dunst/dunstrc
-xscreensaver-command -restart
themes-list: submodules
@echo
@echo "Usage: $ make theme q=mocha[-256]"
@echo
@ls -1 $(THEME_DIR)/base16-*.Xresources \
| xargs basename --suffix=.Xresources \
| grep -v 256 \
| sed 's/base16-//g' \
| xargs basename --suffix=.Xresources \
| column
# New base16 themes: https://github.com/chriskempson/base16
.PHONY: fonts
fonts: submodules
@rm -rf ~/.cache/fontconfig
@fc-cache -vf
@$(MAKE) theme
# Check for git submodules which are not initialized (prefixed with "-").
#
# It's possible check if they not initialized _or_ dirty using '^[-]|^[+]'
.PHONY: submodules
submodules:
@if git submodule status | egrep -q '^[-]'; then \
git submodule update --init; \
fi
## Emacs recipes
dotemacs:
@emacs --batch --debug-init \
--eval='(setq use-package-verbose t)' \
--eval='(load "~/.emacs")' \
--eval='(use-package-report)' \
--eval='(message "%s" (with-current-buffer "*use-package statistics*" (buffer-string)))'
elpa:
rm -rf $(HOME)/.emacs.d/elpa
$(MAKE) dotemacs
emacsdaemon:
-emacsclient -e '(kill-emacs)'
emacs --daemon
xflux: bin/bin/xflux
bin/bin/xflux:
curl -L https://justgetflux.com/linux/xflux64.tgz -o xflux64.tgz
tar xvzf xflux64.tgz
mv xflux bin/bin/xflux
rm xflux64.tgz
dockerfile:
cd .circleci/images && \
docker build -t creichert/debian \
--build-arg debian_mirror_url="http://httpredir.debian.org/debian" \
.
docker push creichert/debian