-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·42 lines (34 loc) · 1.37 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·42 lines (34 loc) · 1.37 KB
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
#!/bin/bash
set -e
# --- Configuration ---
# Read the UUID directly from metadata.json
# The '-r' flag removes the quotes from the output string.
EXTENSION_UUID=$(jq -r '.uuid' gnome-extensions/extension/metadata.json)
# Check if jq succeeded and EXTENSION_UUID is set
if [ -z "$EXTENSION_UUID" ]; then
echo "Error: Could not parse UUID from metadata.json. Is 'jq' installed?"
exit 1
fi
# Define installation directory
INSTALL_DIR="$HOME/.local/share/gnome-shell/extensions/$EXTENSION_UUID"
# --- Main Script ---
echo "Installing extension to: $INSTALL_DIR"
# 1. Ensure the target directory exists and is clean
rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
# 2. Copy all necessary source files and directories from the 'extension' folder
echo "Copying source files..."
cp -r gnome-extensions/extension/* "$INSTALL_DIR/"
# 3. Compile the GSettings schema in the installation directory
if [ -d "$INSTALL_DIR/schemas" ]; then
echo "Compiling GSettings schema..."
glib-compile-schemas "$INSTALL_DIR/schemas/"
if [ $? -ne 0 ]; then
echo "Warning: Schema compilation failed. Settings may not work correctly."
fi
else
echo "No schemas/ directory found. Skipping schema compilation."
fi
# 4. Final success message
echo "Extension installed successfully."
echo "Please enable the extension and then restart GNOME Shell (Alt+F2, type 'r', press Enter) or log out."