summaryrefslogtreecommitdiff
path: root/Makefile
blob: b80e2f80d50c904d39ac71807e64e58c53612fba (plain)
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
# Copyright (c) 2014-2015 Kylie McClain <somasis@exherbo.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

VERSION     =2.0.2

DESTDIR		?= /
PREFIX		?= /usr

BASE		=	numix-themes
COLORS		=	Brave-Revival Human-Revival Illustrious-Revival			\
				Noble-Revival Wine-Revival Wise-Revival					\
				Brave-Classic Human-Classic Illustrious-Classic			\
				Noble-Classic Wine-Classic Wise-Classic

WM			=	Shiki-Colors-Classic Shiki-Colors-Classic-EZ 			\
				Shiki-Colors-Classic-Striped Shiki-Colors-Revival		\
				Shiki-Colors-Revival-EZ

PLANK		=	Shiki-Revival Shiki-Classic Shiki-panel Shiki-platform

Shiki-Brave-Revival_menubar_bg			= 212121
Shiki-Human-Revival_menubar_bg			= 212121
Shiki-Illustrious-Revival_menubar_bg	= 212121
Shiki-Noble-Revival_menubar_bg			= 212121
Shiki-Wine-Revival_menubar_bg			= 212121
Shiki-Wise-Revival_menubar_bg			= 212121

Shiki-Brave-Classic_menubar_bg			= 3c3c3c
Shiki-Human-Classic_menubar_bg			= 3c3c3c
Shiki-Illustrious-Classic_menubar_bg	= 3c3c3c
Shiki-Noble-Classic_menubar_bg			= 3c3c3c
Shiki-Wine-Classic_menubar_bg			= 3c3c3c
Shiki-Wise-Classic_menubar_bg			= 3c3c3c

Shiki-Brave-Revival_selected			= 729fcf
Shiki-Human-Revival_selected			= faa546
Shiki-Illustrious-Revival_selected		= f9a1ac
Shiki-Noble-Revival_selected			= ad7fa8
Shiki-Wine-Revival_selected				= df5757
Shiki-Wise-Revival_selected				= 97bf60

Shiki-Brave-Classic_selected			= 729fcf
Shiki-Human-Classic_selected			= faa546
Shiki-Illustrious-Classic_selected		= f9a1ac
Shiki-Noble-Classic_selected			= ad7fa8
Shiki-Wine-Classic_selected				= df5757
Shiki-Wise-Classic_selected				= 97bf60

# xfwm4 is provided by shiki-colors-xfwm, metacity/openbox are not themed
# xfce4-notify is not yet themed as well

all: generate

help:
	@echo "make targets:"
	@echo "    all                      Prepare, generate, and install theme"
	@echo "    clean                    Delete generated themes and base ($(BASE))"
	@echo "    prepare                  Run pre-generation modifications on base theme"
	@echo "    generate                 Generate all colors specified in the Makefile"
	@echo "    Shiki-<color>            Generate Shiki-<color>"
	@echo "    install                  Install themes to $(DESTDIR)$(PREFIX)/share/{plank/,}themes"
	@echo "    uninstall                Uninstall themes from $(DESTDIR)$(PREFIX)/share/{plank/,}themes"
	@echo "    dist                     Create a tar suitable for distribution"
	@echo "    dist-gzip                Create a tar.gz suitable for distribution"
	@echo "    dist-xz                  Create a tar.xz suitable for distribution"
	@echo
	@echo "Base theme: $(BASE)"
	@echo "Default themes to generate: $(foreach COLOR,$(COLORS),Shiki-$(COLOR))"
	@echo "Plank themes: $(PLANK)"
	@echo
	@echo "Notes:"
	@echo "    If you do not want to run \`git submodules update\` during the prepare"
	@echo "    phase, set ${no_git}; ex. \`no_git=true make prepare\`"

prepare:
	[[ "$(no_git)" ]] || git submodule init
	[[ "$(no_git)" ]] || git submodule update -f
	cd $(BASE) && rm -rf xfwm4 metacity-1 openbox-3 xfce-notify-4.0 index.theme

Shiki-%:
	@echo "Generating $@ from $(BASE)..."
	cp -r $(BASE) $@
	find $@ -type f -print0 | xargs -0 sed -i   \
		-e 's/#d64937/#$($@_selected)/g'    \
		-e 's/#2d2d2d/#$($@_menubar_bg)/g'

generate: prepare
	$(foreach COLOR,$(COLORS),make Shiki-$(COLOR);)

clean:
	-rm -rf $(BASE)
	-rm -rf archive-tmp
	@for color in $(COLORS);do \
		echo "rm -rf Shiki-$$color";	\
		rm -rf "Shiki-$$color";			\
	done

install: generate
	mkdir -p $(DESTDIR)$(PREFIX)/share/themes
	mkdir -p $(DESTDIR)$(PREFIX)/share/plank/themes
	$(foreach PLANK_THEME,$(PLANK),cp -r plank/$(PLANK_THEME) $(DESTDIR)$(PREFIX)/share/plank/themes/$(PLANK_THEME);)
	$(foreach COLOR,$(COLORS),cp -r Shiki-$(COLOR) $(DESTDIR)$(PREFIX)/share/themes/Shiki-$(COLOR);)
	$(foreach WM_THEME,$(WM),cp -r $(WM_THEME) $(DESTDIR)$(PREFIX)/share/themes/$(WM_THEME);)

uninstall:
	$(foreach PLANK_THEME,$(PLANK),rm -rf $(DESTDIR)$(PREFIX)/share/plank/$(PLANK_THEME);)
	$(foreach COLOR,$(COLORS),rm -rf $(DESTDIR)$(PREFIX)/share/themes/Shiki-$(COLOR);)
	$(foreach WM_THEME,$(WM),rm -rf $(DESTDIR)$(PREFIX)/share/themes/$(WM_THEME);)

sync: prepare
	git -C $(BASE) reset --hard
	git -C $(BASE) pull origin master
	git add $(BASE)
	git commit -m 'Synchronize with upstream $(BASE)'

dist: clean prepare
	rm -rf shiki-colors-revival-$(VERSION)
	mkdir shiki-colors-revival-$(VERSION)
	cp -r Shiki-Colors-* numix-themes plank Makefile README.md shiki-colors-revival-$(VERSION)/
	find ./shiki-colors-revival-$(VERSION) -name '*.git*' -delete
	tar cvf shiki-colors-revival-$(VERSION).tar shiki-colors-revival-$(VERSION)/
	rm -rf shiki-colors-revival-$(VERSION)

dist-gzip: dist
	gzip -c shiki-colors-revival-$(VERSION).tar > shiki-colors-revival-$(VERSION).tar.gz

dist-xz: dist
	xz -c shiki-colors-revival-$(VERSION).tar > shiki-colors-revival-$(VERSION).tar.xz

.PHONY: all clean dist dist-gzip dist-xz generate help install prepare sync uninstall