Skip to content

Agent Protocol

Both agents share the same transport and baseline command flow.

Socket paths

Default sockets:

  • calendar agent: /tmp/EasyBar/calendar-agent.sock
  • network agent: /tmp/EasyBar/network-agent.sock

EasyBar connects to those sockets directly.

Other local clients can also connect when they speak the same protocol.

Transport format

  • newline-delimited JSON
  • one request per line
  • one response per line

Example:

{ "command": "ping" }

Common commands

Common commands include:

  • ping
  • version
  • fetch
  • subscribe

The calendar agent additionally supports:

  • create_event
  • update_event
  • delete_event

Every response includes a kind field.

Common kinds include:

  • pong
  • version
  • subscribed
  • error

Typical behavior

  • ping returns one pong, then closes
  • version returns one version payload, then closes
  • fetch returns one data payload, then closes
  • subscribe returns one subscribed, returns one immediate data payload, then keeps the socket open for later pushes

EasyBar command behavior

EasyBar keeps long-lived subscriptions open to the agents for normal runtime updates.

A manual refresh:

easybar --refresh
  • does not reload config
  • does not restart agents
  • triggers fresh reads and UI updates

A Lua restart:

easybar --restart-lua-runtime
  • restarts only Lua
  • does not restart agents

A config reload:

easybar --reload-config
  • reloads config.toml
  • rebuilds runtime state
  • recreates agent-backed subscriptions