#!/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" 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