-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
executable file
·73 lines (58 loc) · 1.81 KB
/
deploy.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
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
MODE="deploy"
if [ "$1" = "zip" ]; then
MODE="zip"
fi
# Use 'gnome-extension' command when available
# This command was introduced in gnome 3.34
if [ -x "$(command -v gnome-extensions)" ]; then
echo "Packing extension ..."
gnome-extensions pack \
--force \
--gettext-domain=keyman \
--podir=locale/ \
--extra-source=prefs.ui \
--extra-source=clipboard.js \
--extra-source=data.js \
--extra-source=keyman.js \
--extra-source=keyringDbus.js \
--extra-source=utils.js \
--extra-source=settings.js
if [ "$MODE" = "zip" ]; then
echo "Renaming pack to keyman.zip"
mv [email protected] keyman.zip
exit 0
fi
echo "Installing extension ..."
gnome-extensions install --force [email protected]
echo "Enabling extension ..."
gnome-extensions enable [email protected]
# echo "Restarting gnome shell..."
# gnome-shell --replace &
exit 0
fi
echo "Command 'gnome-extensions' not found. Falling back to manual builds..."
FILES="extension.js keyman.js clipboard.js keyringDbus.js"
FILES="$FILES utils.js data.js settings.js prefs.js metadata.json"
FILES="$FILES LICENSE README.md schemas/ locale/ keyman.pot stylesheet.css"
echo "Compiling locales..."
for locpath in locale/*.po; do
locale=${locpath%.*}
mkdir -p $locale/LC_MESSAGES
msgfmt -o $locale/LC_MESSAGES/keyman.mo $locpath
done
echo "Compiling schemas..."
glib-compile-schemas schemas/
if [ $MODE = "deploy" ]; then
DEST=~/.local/share/gnome-shell/extensions/[email protected]
echo "Removing old instance..."
rm -r $DEST
mkdir -p $DEST
echo "Copying content..."
cp -a $FILES $DEST/
# echo "Restarting gnome shell..."
# gnome-shell --replace &
else
echo "Creating keyman.zip..."
zip -r keyman.zip $FILES
fi