forked from pop-os/shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (67 loc) · 2.15 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
# Retrieve the UUID from ``metadata.json``
UUID = $(shell grep -E '^[ ]*"uuid":' ./metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@')
ifeq ($(strip $(DESTDIR)),)
INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions
else
INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions
endif
INSTALLNAME = $(UUID)
$(info UUID is "$(UUID)")
.PHONY: all clean install zip-file
sources = src/*.ts *.css
all: depcheck compile
clean:
rm -rf _build schemas/gschemas.compiled
transpile: $(sources)
tsc
compile: convert metadata.json schemas
rm -rf _build
mkdir -p _build
cp -r metadata.json icons schemas target/*.js imports/*.js *.css _build
convert: transpile
for file in target/*.js; do \
sed -i \
-e 's#export function#function#g' \
-e 's#export var#var#g' \
-e 's#export const#var#g' \
-e 's#Object.defineProperty(exports, "__esModule", { value: true });#var exports = {};#g' \
"$${file}"; \
sed -i -E 's/export class (\w+)/var \1 = class \1/g' "$${file}"; \
sed -i -E "s/import \* as (\w+) from '(\w+)'/const \1 = Me.imports.\2/g" "$${file}"; \
done
depcheck:
@echo depcheck
@if ! command -v tsc >/dev/null; then \
echo \
echo 'You must install TypeScript >= 3.8 to transpile: (node-typescript on Debian systems)'; \
exit 1; \
fi
enable:
gnome-extensions enable "[email protected]"
disable:
gnome-extensions disable "[email protected]"
listen:
journalctl -o cat -n 0 -f "$$(which gnome-shell)" | grep -v warning
install:
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
mkdir -p $(INSTALLBASE)/$(INSTALLNAME)
cp -r _build/* $(INSTALLBASE)/$(INSTALLNAME)/
uninstall:
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
restart-shell:
echo "Restart shell!"
if bash -c 'xprop -root &> /dev/null'; then \
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting Gnome...")'; \
else \
gnome-session-quit --logout; \
fi
update-repository:
git fetch origin
git reset --hard origin/master_focal
git clean -fd
schemas: schemas/gschemas.compiled
touch $@
schemas/gschemas.compiled: schemas/*.gschema.xml
glib-compile-schemas schemas
zip-file: all
cd _build && zip -qr "../$(UUID)$(VSTRING).zip" .