This is a MIT-licensed library to interface with i3wm via its IPC interface, requiring Batteries. Install it via OPAM or whatever.
./configure make make install
This example retrieves the workspaces list as JSON (already parsed with Yojson).
open I3;; let workspaces = get_workspaces socketpath
First of all, this is really WIP, so don't use it if you worry about stability. I didn't implement the SUSCRIBE query, because I'll have to understand it first ...