AI crammed into a tray icon, formerly grok-tray.
  • PureBasic 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-16 22:28:32 -05:00
aiciti.pb Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
aiciti.pbp Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
aicitifrm.pbf Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
LICENSE.md Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
linkeroptions Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
logo.png Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
mistral.png Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
README.md Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00
trayIcon.png Rename GrokTray to aiciti and remove bundled binaries 2026-11-16 22:28:32 -05:00

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_ai global at the top of aiciti.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-open as fallback) instead of navigating the tray window or being dropped. WebKitGTK's create and decide-policy signals 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 --show or no argument summons the running instance; --hide dismisses 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 ImportC calls that add or realize widgets — on WebKitGTK 2.54 that leaves the renderer unattached after the window is hidden (blank view). WebGadget handles 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.