forked from pop-os/gnome-shell-extension-system76-power
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
65 lines (48 loc) · 1.48 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
# 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 stylesheet.css
all: depcheck compile
clean:
rm -rf _build
transpile: $(sources)
tsc
compile: convert metadata.json
rm -rf _build
mkdir -p _build
cp -r metadata.json target/*.js stylesheet.css _build
convert: transpile
#null
depcheck:
if ! command -v tsc >/dev/null; then \
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
zip-file: all
cd _build && zip -qr "../$(UUID)$(VSTRING).zip" .