summaryrefslogtreecommitdiff
path: root/scripts/install-extension
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2026-07-24 12:38:02 +0200
committerYuval Adam <_@yuv.al>2026-07-24 12:38:02 +0200
commita0e54437fe03b36903faa8b600b6ba903cb15392 (patch)
tree049de98522cf6bac18c548edee8b4d56b7ed24c0 /scripts/install-extension
parent8e64e5eef0173b3f7586404650151acc684e57d7 (diff)
Add GNOME Shell status indicator
Diffstat (limited to 'scripts/install-extension')
-rwxr-xr-xscripts/install-extension36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/install-extension b/scripts/install-extension
new file mode 100755
index 0000000..2d42288
--- /dev/null
+++ b/scripts/install-extension
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
+uuid=parley@org.parley
+destination=${XDG_DATA_HOME:-$HOME/.local/share}/gnome-shell/extensions/$uuid
+
+mkdir -p "$(dirname -- "$destination")"
+if [[ -L "$destination" ]]; then
+ unlink "$destination"
+elif [[ -e "$destination" ]]; then
+ rm -rf -- "$destination"
+fi
+ln -s "$root/extension" "$destination"
+
+cd "$root"
+uv run python - "$uuid" <<'PY'
+import sys
+from gi.repository import Gio
+
+uuid = sys.argv[1]
+settings = Gio.Settings.new("org.gnome.shell")
+enabled = list(settings.get_strv("enabled-extensions"))
+if uuid not in enabled:
+ enabled.append(uuid)
+ if not settings.set_strv("enabled-extensions", enabled):
+ raise SystemExit("could not update GNOME's enabled extension list")
+PY
+
+if gnome-extensions info "$uuid" >/dev/null 2>&1; then
+ gnome-extensions enable "$uuid"
+ echo "Installed and enabled $uuid from $root/extension"
+else
+ echo "Installed and marked $uuid for enablement."
+ echo "Log out and back in once so GNOME Shell discovers the new extension."
+fi