-
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.48 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·42 lines (34 loc) · 1.48 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
# Install script for Copilot Usage GNOME extension
EXTENSION_UUID="copilot-usage@local"
EXTENSION_DIR="$HOME/.local/share/gnome-shell/extensions/$EXTENSION_UUID"
SRC_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "Installing Copilot Usage extension..."
# Create extension directory
mkdir -p "$EXTENSION_DIR/schemas"
# Copy files
cp "$SRC_DIR/metadata.json" "$EXTENSION_DIR/"
cp "$SRC_DIR/extension.js" "$EXTENSION_DIR/"
cp "$SRC_DIR/prefs.js" "$EXTENSION_DIR/"
cp "$SRC_DIR/stylesheet.css" "$EXTENSION_DIR/"
# Bundle the copilot-usage-cli script; the extension runs it with node.
cp "$SRC_DIR/copilot-usage-cli/copilot-usage.js" "$EXTENSION_DIR/"
cp "$SRC_DIR/schemas/"*.xml "$EXTENSION_DIR/schemas/"
# Compile schemas in the extension directory
glib-compile-schemas "$EXTENSION_DIR/schemas/"
# Sanity check: the extension needs node to run the bundled CLI.
if ! command -v node >/dev/null 2>&1; then
echo "WARNING: 'node' not found on PATH. Install Node.js (>=14) so the extension can run copilot-usage.js."
fi
echo "Extension installed to: $EXTENSION_DIR"
echo ""
echo "To enable the extension:"
echo " 1. Log out and log back in (or press Alt+F2, type 'r', press Enter on X11)"
echo " 2. Enable the extension with: gnome-extensions enable $EXTENSION_UUID"
echo " 3. Or use the GNOME Extensions app to enable it"
echo ""
echo "To configure:"
echo " gnome-extensions prefs $EXTENSION_UUID"
echo ""
echo "To test it in a nested shell:"
echo " dbus-run-session gnome-shell --devkit --wayland"