forked from velitasali/gnome-shell-extension-awesome-tiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·63 lines (53 loc) · 1.41 KB
/
install.sh
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
#!/usr/bin/env bash
set -e
if [ "$UID" = "0" ]; then
echo 'This should not be run as root'
exit 101
fi
NAME=awesome-tiles\@velitasali.com
function pack-extension {
echo "Packing extension..."
gnome-extensions pack src \
--force \
--podir="../po" \
--extra-source="constants.js" \
--extra-source="prefs.ui" \
--extra-source="prefs-shortcut-dialog.ui" \
--extra-source="utils.js" \
--extra-source="../LICENSE"
}
function compile-preferences {
if [ -d src/schemas ]; then
echo 'Compiling preferences...'
glib-compile-schemas --targetdir=src/schemas src/schemas
else
echo 'No preferences to compile... Skipping'
fi
}
function restart-shell {
echo 'Restarting shell...'
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
echo 'Done'
}
function usage() {
echo 'Usage: ./install.sh COMMAND'
echo 'COMMAND:'
echo " local-install install the extension in the user's home directory"
echo ' under ~/.local'
echo ' zip Creates a zip file of the extension'
}
case "$1" in
"local-install" )
compile-preferences
pack-extension
gnome-extensions install --force $NAME.shell-extension.zip && restart-shell
;;
"zip" )
compile-preferences
pack-extension
;;
* )
usage
;;
esac
exit