-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (82 loc) · 2.51 KB
/
Copy pathMakefile
File metadata and controls
95 lines (82 loc) · 2.51 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
# Makefile for ShellGlance GNOME Shell Extension
NAME = shellglance
DOMAIN = dnlvgl.com
UUID = $(NAME)@$(DOMAIN)
INSTALL_DIR = $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
BUILD_DIR = build
# Files to include in distribution
DIST_FILES = \
extension.js \
prefs.js \
stylesheet.css \
metadata.json \
schemas/org.gnome.shell.extensions.$(NAME).gschema.xml \
schemas/gschemas.compiled \
icons/error-symbolic.svg \
LICENSE
.PHONY: help
help:
@echo "ShellGlance Makefile"
@echo ""
@echo " make install - First-time install"
@echo " make update - Update installed extension and open Extensions app"
@echo " make enable - Enable the extension"
@echo " make disable - Disable the extension"
@echo " make prefs - Open extension preferences"
@echo " make logs - Follow GNOME Shell logs"
@echo " make zip - Create distributable zip"
@echo " make clean - Remove build artifacts"
.PHONY: schemas
schemas:
glib-compile-schemas schemas/
# First-time install
.PHONY: install
install: schemas
@if [ -d "$(INSTALL_DIR)" ]; then \
echo "Already installed. Use 'make update' instead."; \
exit 1; \
fi
@mkdir -p $(INSTALL_DIR)/schemas $(INSTALL_DIR)/icons
cp extension.js prefs.js stylesheet.css metadata.json $(INSTALL_DIR)/
cp schemas/*.xml schemas/gschemas.compiled $(INSTALL_DIR)/schemas/
cp icons/*.svg $(INSTALL_DIR)/icons/
@echo "Installed to $(INSTALL_DIR)"
@echo "Run 'make enable' to enable the extension"
# Update existing install and open Extensions app for testing
.PHONY: update
update: schemas
@if [ ! -d "$(INSTALL_DIR)" ]; then \
echo "Not installed. Use 'make install' first."; \
exit 1; \
fi
rm -rf $(INSTALL_DIR)/*
@mkdir -p $(INSTALL_DIR)/schemas $(INSTALL_DIR)/icons
cp extension.js prefs.js stylesheet.css metadata.json $(INSTALL_DIR)/
cp schemas/*.xml schemas/gschemas.compiled $(INSTALL_DIR)/schemas/
cp icons/*.svg $(INSTALL_DIR)/icons/
@echo "Updated $(INSTALL_DIR)"
@gnome-extensions disable $(UUID) 2>/dev/null || true
@gnome-extensions enable $(UUID)
@echo "Extension reloaded"
.PHONY: enable
enable:
gnome-extensions enable $(UUID)
.PHONY: disable
disable:
gnome-extensions disable $(UUID)
.PHONY: prefs
prefs:
gnome-extensions prefs $(UUID)
.PHONY: logs
logs:
journalctl -f -o cat /usr/bin/gnome-shell
.PHONY: zip
zip: schemas
@mkdir -p $(BUILD_DIR)
@rm -f $(BUILD_DIR)/$(UUID).zip
@zip -r $(BUILD_DIR)/$(UUID).zip $(DIST_FILES)
@echo "Created $(BUILD_DIR)/$(UUID).zip"
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
rm -f schemas/gschemas.compiled