-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
run.sh
executable file
·54 lines (51 loc) · 2.02 KB
/
run.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
#!/bin/bash
# Check if the script is being run as root
if [ "$(id -u)" -eq 0 ]; then
echo "Error: This script should not be run as root" >&2
exit 1
fi
UUID="hanabi-extension@jeffshee.github.io"
if [ "$1" == "install" ]; then
rm -rf .build
meson setup .build --prefix=$HOME/.local/ && ninja -C .build install
elif [ "$1" == "enable" ]; then
gnome-extensions enable "$UUID"
elif [ "$1" == "disable" ]; then
gnome-extensions disable "$UUID"
elif [ "$1" == "prefs" ]; then
gnome-extensions prefs "$UUID"
elif [ "$1" == "reset" ]; then
gnome-extensions reset "$UUID"
elif [ "$1" == "uninstall" ]; then
gnome-extensions uninstall "$UUID"
elif [ "$1" == "renderer" ]; then
shift
./src/renderer/renderer.js "$@"
elif [ "$1" == "log" ]; then
journalctl -f -o cat /usr/bin/gnome-shell
elif [ "$1" == "pot" ]; then
POT_FILE="src/po/hanabi-extension@jeffshee.github.io.pot"
find src/ -iname "*.js" -print0 | xargs -0 xgettext --from-code=UTF-8 --output="$POT_FILE"
sed -i "s/SOME DESCRIPTIVE TITLE./Gnome Shell Extension - Hanabi/g" "$POT_FILE"
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2023 Jeff Shee (jeffshee8969@gmail.com)/g" "$POT_FILE"
sed -i "s/PACKAGE package/gnome-ext-hanabi package/g" "$POT_FILE"
sed -i "s/PACKAGE VERSION/1/g" "$POT_FILE"
sed -i "s/CHARSET/UTF-8/g" "$POT_FILE"
elif [ "$1" == "help" ]; then
echo "Valid actions are:"
echo " - install: Installs the extension."
echo " - enable: Enables the extension."
echo " - disable: Disables the extension."
echo " - prefs: Opens the extension preferences."
echo " - reset: Resets the extension settings."
echo " - uninstall: Uninstalls the extension."
echo " - renderer: Runs the renderer with the given arguments."
echo " - log: Displays the GNOME Shell log."
echo " - pot: Generate template pot file."
echo "Usage: $0 [action]"
echo "Run '$0 help' to see this message."
exit 0
else
echo "Error: Invalid action. Run '$0 help' to see valid actions." >&2
exit 1
fi