aboutsummaryrefslogtreecommitdiffstats
path: root/base/Makefile
blob: 9752ef1298733673c77c04169efdf54df92b6342 (plain) (blame)
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
.POSIX:

FACE = penguin.png

XINITRC_ORDER = 90

install:
	mkdir -p -- ~/.config
	test ! -e ~/.profile || test -L ~/.profile
	test ! -e ~/.config/user-profile || test -L ~/.config/profile
	test ! -e ~/.config/user-profile-North || test -L ~/.config/profile-North
	test ! -e ~/.config/user-profile-Zenith || test -L ~/.config/profile-Zenith
	test ! -e ~/.config/user-dirs.locale || test -L ~/.config/user-dirs.locale
	test ! -e ~/.config/face || test -L ~/.config/face || \
		sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.config/face | cut -d ' ' -f 1)" > /dev/null
	test ! -e ~/.face || test -L ~/.face || \
		sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face | cut -d ' ' -f 1)" > /dev/null
	test ! -e ~/.face.icon || test -L ~/.face.icon || \
		sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face.icon | cut -d ' ' -f 1)" > /dev/null
	ln -sf -- .config/profile ~/.profile
	ln -sf -- ~/.dotfiles/base/user-profile ~/.config/profile
	ln -sf -- ~/.dotfiles/base/user-profile-North ~/.config/profile-North
	ln -sf -- ~/.dotfiles/base/user-profile-Zenith ~/.config/profile-Zenith
	ln -sf -- ~/.dotfiles/base/user-dirs.locale ~/.config/
	ln -sf -- ~/.dotfiles/base/faces/$(FACE) ~/.config/face
	ln -sf -- .config/face ~/.face
	ln -sf -- .face ~/.face.icon
	if test -L ~/.config/locations; then \
		test "$$(readlink -- ~/.config/locations)" = ~/.dotfiles/.secrets/locations; \
	else \
		test ! -e ~/.config/locations && \
		ln -s -- ~/.dotfiles/.secrets/locations ~/.config/locations; \
	fi
	test ! -e ~/.config/geolocation || test -L ~/.config/geolocation
	test ! -e ~/.config/metar || test -L ~/.config/metar
	test -L ~/.config/locations/current || test ! -e ~/.config/locations/current
	test -L ~/.config/locations/current || ln -sf default ~/.config/locations/current
	ln -sf locations/current/geolocation ~/.config/geolocation
	ln -sf locations/current/metar ~/.config/metar
	mkdir -p -- ~/.local/bin
	test ! -d ~/.local/bin/iswork
	test -x /bin/false && test -x /bin/true
	if test -e "../.secrets/workmachine-$$(hostname)"; then \
		ln -sf -- /bin/true ~/.local/bin/iswork; \
	else \
		ln -sf -- /bin/false ~/.local/bin/iswork; \
	fi
	test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) install)
	mkdir -p -- ~/.config/X11/xinit/xinitrc.d
	test ! -e ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base || \
		test -L ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base
	ln -sf -- ~/.dotfiles/base/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base

uninstall:
	+! ../check-installed base
	-unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base
	-rmdir -- ~/.config/X11/xinit/xinitrc.d
	-rmdir -- ~/.config/X11/xinit
	-rmdir -- ~/.config/X11
	-unlink -- ~/.config/user-profile
	-unlink -- ~/.config/user-profile-North
	-unlink -- ~/.config/user-profile-Zenith
	-unlink -- ~/.config/user-dirs.locale
	-unlink -- ~/.profile
	-unlink -- ~/.config/locations
	-unlink -- ~/.config/geolocation
	-unlink -- ~/.config/metar
	-unlink -- ~/.local/bin/iswork
	-test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) uninstall)