A lightweight desktop companion for Google Antigravity on Linux (KDE Plasma + Wayland / X11).
Surfaces ask_question, permissions, and approvals as an always-on-top modal dialog and persistent system tray icon, letting you respond to the AI assistant in milliseconds without switching away from your active workflow.
- Universal Multi-Project Discovery: Automatically monitors active Antigravity Language Servers across all workspace folders and projects on your system via active background polling (
needsAttention: true). Global installation covers everything without per-project setup. - Always-On-Top Modal: Compact, content-driven dark modal with project title badge (
📁 <project_name>), session ID, model tag, and queue indicators. - Keyboard-First Navigation:
- Question Dialogs:
1–9directly selects visible options;↑/↓/Tabnavigates;Entersubmits. - Permission Dialogs:
1orEnter: Allow this time (PERMISSION_SCOPE_ONCE)2: Always allow in this conversation (PERMISSION_SCOPE_CONVERSATION)3: Always allow globally (PERMISSION_SCOPE_GLOBAL)4orD: Deny←/→/Tab: Navigate between all permission action buttons.
Esc: Hide to system tray (does not deny or cancel the interaction; remains pending and accessible from tray).
- Question Dialogs:
- Persistent System Tray: Dynamic numeric badge rendered into the tray icon via
QPainter. Left-click to reopen pending requests; right-click context menu for quick controls. - Multi-Session FIFO Queue: Seamlessly queues interactions across multiple concurrent agent conversations.
- Ultra-Low Resource Footprint: Pure event-driven Qt event loop with ~0% idle CPU and ~70–90MB RAM.
| Specification | Detail |
|---|---|
| Language & Runtime | Python 3.11+ (Tested on Python 3.11, 3.12, 3.14) |
| GUI Framework | PySide6 / Qt6 Widgets (QApplication, QDialog, QSystemTrayIcon) |
| Local IPC | QLocalServer & QLocalSocket (Unix Domain Socket at $XDG_RUNTIME_DIR/ag-attention-bridge.sock) |
| Antigravity Transport | Loopback HTTPS ConnectRPC (127.0.0.1:<dynamic_port>) with dynamic CSRF authentication |
| Primary Platform | Linux with KDE Plasma (Wayland / X11) |
| Antigravity Compatibility | Antigravity IDE 1.1.3+ (Extension 0.2.0+, commit ecfbad74d939) |
| Process Model | Single background daemon per user session; lightweight CLI adapter for hook execution (<15ms) |
Ensure Python 3.11+ and standard Qt6 build libraries are available on your system:
# Debian / Ubuntu
sudo apt install python3 python3-venv libgl1 libegl1 libxkbcommon0
# Arch Linux / Manjaro
sudo pacman -S python libglvnd libxkbcommon
# Fedora
sudo dnf install python3 libglvnd-glx libxkbcommon# Clone the repository
git clone https://github.com/ekyaaa/ag-attention-bridge.git
cd ag-attention-bridge
# Create virtual environment and install dependencies
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -e .Run the automated installation script:
bash scripts/install-hooks.shThis script will:
- Symlink
ag-hook-adapterandag-attention-bridgeinto~/.local/bin/. - Automatically configure global Antigravity hooks in
~/.gemini/config/hooks.json. - Start the
ag-attention-bridgedaemon in the background with the system tray icon active.
For optimal focus and keep-above behavior under KDE Wayland, configure a KWin Rule:
- Open System Settings → Window Management → Window Rules → Add New...
- Configure:
- Description:
Ag Attention Bridge Keep Above - Window class (application): Exact Match
ag-attention-bridge - Keep above: Force →
Yes - Initial placement: Force →
Centered - Focus stealing prevention: Force →
None - Skip taskbar / pager:
Yes
- Description:
To completely remove hooks and stop the daemon:
bash scripts/uninstall-hooks.shThe core architecture of Ag Attention Bridge is modular and decoupled:
Antigravity Hooks ──► Hook Adapter ──► Local IPC ──► Daemon / Domain ──► UI Modal
All hook handling, protocol serialization, ConnectRPC client code, queue management, and domain models are platform-independent. To support other desktop environments or operating systems, refer to the guidance below.
| Area | Current (KDE) | Adaptation Required for GNOME |
|---|---|---|
| System Tray | KDE Plasma StatusNotifierItem (SNI) | GNOME Shell removed native system tray icons. Users must install the AppIndicator and KStatusNotifierItem Support GNOME extension (gnome-shell-extension-appindicator). |
| Keep-Above Window | KWin Window Rule | GNOME Wayland (Mutter) does not support KWin rules. Qt.WindowStaysOnTopHint provides basic keep-above. For forced focus, users can use Mutter window rules or a GNOME extension like Always on Top. |
| Process Discovery | /proc inspection |
No changes needed; works out of the box on Linux GNOME. |
| IPC Socket | Unix Domain Socket | No changes needed; uses $XDG_RUNTIME_DIR. |
- Hyprland: Add floating and pinning rules to
hyprland.conf:windowrulev2 = float, class:^(ag-attention-bridge)$ windowrulev2 = pin, class:^(ag-attention-bridge)$ windowrulev2 = center, class:^(ag-attention-bridge)$
- Sway / i3: Add floating rule to config:
for_window [app_id="ag-attention-bridge"] floating enable, sticky enable, border pixel 2
- Waybar / Polybar: Ensure the bar includes the
traymodule;QSystemTrayIconpublishes automatically via DBus SNI.
To port Ag Attention Bridge to Windows:
- Process Discovery (
discovery.py):- Windows does not have
/proc. - Replace
/procparsing withpsutilorctypes/Win32 API (CreateToolhelp32Snapshot,Process32First):import psutil for proc in psutil.process_iter(['pid', 'name', 'cmdline']): if proc.info['name'] == 'language_server_windows_x64.exe': cmdline = proc.info['cmdline'] # Extract --csrf_token and other parameters
- Windows does not have
- Local IPC (
client.py&server.py):- Qt's
QLocalServerandQLocalSocketautomatically map to Windows Named Pipes (\\.\pipe\ag-attention-bridge) without code changes.
- Qt's
- Always-On-Top Window:
Qt.WindowType.WindowStaysOnTopHintworks reliably on Win32 out of the box.
- System Tray:
QSystemTrayIconis fully supported on the Windows Notification Area.
- Hooks Configuration:
- On Windows, Antigravity loads hooks from
%USERPROFILE%\.gemini\config\hooks.json. - Use an
.exewrapper or batch script launcher in place of bash scripts.
- On Windows, Antigravity loads hooks from
To port Ag Attention Bridge to macOS:
- Process Discovery:
- Search for
language_server_darwin_arm64orlanguage_server_darwin_x64usingpsutilorsysctl.
- Search for
- Menu Bar / System Tray:
QSystemTrayIconnatively renders into the macOS menu bar.
- Window Stays-On-Top:
Qt.WindowStaysOnTopHintworks out of the box. For strict overlay behavior over full-screen apps, use PyObjC:from AppKit import NSFloatingWindowLevel ns_window.setLevel_(NSFloatingWindowLevel)
- Hooks Path:
- Antigravity hooks on macOS reside in
~/.gemini/config/hooks.json.
- Antigravity hooks on macOS reside in
The project includes an extensive test suite covering IPC serialization, process discovery, ConnectRPC client transport, idempotency guards, and UI event flows:
# Run full test suite (63 unit and integration tests)
.venv/bin/pytest -vYou can test the native ConnectRPC interaction flow directly from the terminal without the modal:
.venv/bin/python3 scripts/test_native_interaction.py --workspace /path/to/workspaceComprehensive engineering documentation and version upgrade guides are available in the docs/ directory:
NATIVE_INTERACTION_IMPLEMENTATION.md: Deep-dive into the ConnectRPC architecture, candidate selection algorithm, step anatomy, and modal header integration.ANTIGRAVITY_NATIVE_INTERACTION_RESEARCH.md: Original reverse-engineering findings and protocol analysis of Antigravity internal runtime.docs/version/README.md: Version compatibility matrix.docs/version/ANTIGRAVITY_1.1.3_SPEC.md: Baseline technical specification for Antigravity 1.1.3 (binary hashes, flags, endpoints, protobuf schemas).docs/version/UPGRADE_GUIDE.md: Step-by-step diagnostic runbook, code modification mapping table, and troubleshooting tree for when Antigravity releases updates.
MIT License. Developed for use with Google Antigravity.