Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 62 lines (53 sloc) 1.962 kB
8bc1462 @wjt Initial commit.
authored
1 EXT_DIR="$(HOME)/.local/share/gnome-shell/extensions"
2 UUID=`perl -nle 'if (m{"uuid": "([^"]+)"}) { print $$1 }' metadata.json`
72efefe @wjt Make sure edit-groups gets installed
authored
3 FILES="README.md extension.js metadata.json edit-groups"
8bc1462 @wjt Initial commit.
authored
4
5 SCHEMA="org.gnome.shell"
6 KEY="enabled-extensions"
7 STATUS=$$(gsettings get $(SCHEMA) $(KEY) | grep "$(UUID)" > /dev/null 2>&1; if [ $$? = "0" ]; then echo "enabled"; else echo "disabled"; fi)
8
9 all:
10
11 install:
12 @mkdir -p $(EXT_DIR)/$(UUID)
13 @for f in "$(FILES)"; do \
14 cp -f $$f $(EXT_DIR)/$(UUID)/$$f; \
15 done
16 @if [ $(STATUS) = "enabled" ]; then \
17 echo "To reload the shell (and the extension) press ALT-F2 and type 'r'."; \
18 else \
19 echo "To enable the extension type 'make enable'."; \
20 fi
21
22 uninstall: disable-internal
23 @for f in "$(FILES)"; do \
24 rm $(EXT_DIR)/$(UUID)/$$f; \
25 done
26 @rmdir $(EXT_DIR)/$(UUID)
27
28 enable: disable-internal
29 @if [ ! -d "$(EXT_DIR)/$(UUID)" ]; then \
30 echo "Before enabling the extension you have to install it with 'make install'"; \
31 exit 1; \
32 fi
33 @curr_val=`gsettings get $(SCHEMA) $(KEY)`; \
34 full_id="'$(UUID)'"; \
35 other_extensions=`echo "$$curr_val" | sed -e "s/]$$//"`; \
36 new_val="$$other_extensions, $$full_id]"; \
37 new_val=`echo "$$new_val" | sed -e 's/\[, /[/'` ; \
38 gsettings set $(SCHEMA) $(KEY) "$$new_val"
39 @echo "To reload the shell (and the extension) press ALT-F2 and type 'r'."; \
40
41 disable: disable-internal
42 @if [ $(STATUS) = "enabled" ]; then \
43 echo "I cannot disable the extension!"; \
44 exit 1; \
45 fi
46
47 disable-internal:
48 @curr_val=`gsettings get $(SCHEMA) $(KEY)`; \
49 full_id="'$(UUID)'"; \
50 new_val=`echo "$$curr_val" | sed -e "s/$$full_id//"`; \
51 new_val=`echo "$$new_val" | sed -e 's/, ]/]/'` ; \
52 new_val=`echo "$$new_val" | sed -e 's/\[, /[/'` ; \
53 new_val=`echo "$$new_val" | sed -e 's/, ,/,/'` ; \
54 gsettings set $(SCHEMA) $(KEY) "$$new_val"
55
56 status:
57 @if [ $(STATUS) = "enabled" ]; then \
58 echo "The extension is enabled"; \
59 else \
60 echo "The extension is disabled"; \
61 fi
Something went wrong with that request. Please try again.