- PureBasic 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| aiciti.pb | ||
| aiciti.pbp | ||
| aicitifrm.pbf | ||
| LICENSE.md | ||
| linkeroptions | ||
| logo.png | ||
| mistral.png | ||
| README.md | ||
| trayIcon.png | ||
aiciti
AI crammed into a system tray icon. A small PureBasic app that embeds a
WebKitGTK web view (PureBasic's native WebGadget) in a window you can summon
and dismiss from the system tray — your AI chat, one hotkey away.
Formerly known as grok-tray.
What it does
- Lives in the system tray; the window starts hidden.
- Summon or dismiss via the tray menu ("Summon AI" / "Dismiss AI"), via a desktop hotkey (see below), or by closing the window (it just re-hides).
- Two chat frontends, switchable from the tray menu: Grok (grok.com) and
Mistral (chat.mistral.ai). The default is set by the
current_aiglobal at the top ofaiciti.pb. Switching reloads the page; hide/show does not, so your conversation survives. - Links clicked inside the web view are handed off to the system's default
browser (GIO default app for the URI scheme,
xdg-openas fallback) instead of navigating the tray window or being dropped. WebKitGTK'screateanddecide-policysignals are hooked for this; no second web view is spawned. - Cookies persist across restarts in
~/.groktray/grok-viewer-cookies.sqlite(SQLite, via WebKitGTK's cookie manager), so you stay logged in. - Single instance: a pid file (
~/.groktray/groktray.pid) plus a FIFO (~/.groktray/groktray.fifo). Starting a second copy with--showor no argument summons the running instance;--hidedismisses it. - Handles SIGTERM/SIGINT/SIGHUP with a flag-only signal handler and a graceful shutdown in the main loop, so a system shutdown/reboot lets WebKitGTK flush the cookie database cleanly instead of being killed mid-write.
Usage
Run the binary once:
./aiciti
Then bind a hotkey in your desktop environment to toggle it, e.g.:
aiciti --show # summon (also the default with no argument)
aiciti --hide # dismiss
Or drive it from the tray menu. Exit from the tray menu ("Exit") cleans up the pid file and FIFO.
Requirements
- Linux (x64) with GTK 3 and WebKitGTK 4.1 (
libwebkit2gtk-4.1) - A system tray / StatusNotifier host
xdg-open(only as a fallback for URI schemes GIO has no handler for)- PureBasic 6.41 (Linux - x64) to build
The app sets WEBKIT_DISABLE_COMPOSITING_MODE=1 and
WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 internally — workarounds for WebKitGTK
2.54 going blank after hide/show on X11.
Building
Open aiciti.pbp in the PureBasic IDE and compile, or from the command line:
pbcompiler aiciti.pb
Source files: aiciti.pb (all the logic) and aicitifrm.pbf (the window form).
The compiler must be PureBasic 6.41 for Linux x64.
Notes
- Do not drive the web view through manual GTK/WebKit
ImportCcalls that add or realize widgets — on WebKitGTK 2.54 that leaves the renderer unattached after the window is hidden (blank view).WebGadgethandles realization/redraw correctly; the link-click handlers only attach signal callbacks to the existing view. - Runtime data lives in
~/.groktray/(the directory kept the old name):groktray.pid,groktray.fifo,grok-viewer-cookies.sqlite.
License
MIT — see LICENSE.md.