-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.sh
executable file
·43 lines (31 loc) · 1.05 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
#!/bin/bash
BASE_PATH="$(dirname "$(realpath "$0")")"
# If XDG_DATA_HOME is not set, guess its path
if [[ -z "$XDG_DATA_HOME" ]]; then
XDG_DATA_HOME="$HOME/.local/share"
fi
ALL_EXTENSIONS_PATH="$XDG_DATA_HOME/gnome-shell/extensions"
EXTENSION_NAME="[email protected]"
EXTENSION_PATH="$ALL_EXTENSIONS_PATH/$EXTENSION_NAME"
echo "Extension directory path: $EXTENSION_PATH"
# Ensure that extensions directory exists
if [ ! -d "$ALL_EXTENSIONS_PATH" ]; then
echo "Extension directory not found. Exiting."
exit 1
fi
echo "Removing the extension directory..."
# Remove current extension version
rm -rf "$EXTENSION_PATH"
# If 'rm' failed, exit
if [ $? -ne 0 ]; then
echo "Removal of the extension directory failed. Exiting."
exit 1
fi
echo "Copying src/ directory to the extension directory..."
# Copy to extensions folder
cp -r "$BASE_PATH/src" "$EXTENSION_PATH"
if [ $? -ne 0 ]; then
echo "Copying files failed. Exiting."
exit 1
fi
echo "Extension updated. Please restart GNOME Shell to apply changes (logout)."