Module I3ipc
A pure OCaml implementation of the i3 IPC protocol.
type protocol_error=|No_IPC_socket|Bad_magic_string of string|Unexpected_eof|Unknown_type of Stdint.Uint32.t|Bad_reply of stringThe different errors that may be raised.
exceptionProtocol_error of protocol_error
module Reply : sig ... endType definitions for the command replies.
module Event : sig ... endType definitions for the events that can be subscribed to.
Connection to i3
val connect : unit -> connection Lwt.tConnect to a running i3 instance.
val disconnect : connection -> unit Lwt.tClose a
connection.
Event subscription
val subscribe : connection -> subscription list -> Reply.command_outcome Lwt.tSubscribe to certain events.
val next_event : connection -> Event.t Lwt.tWait for the next event, among those subscribed to.
Commands and queries
val command : connection -> string -> Reply.command_outcome list Lwt.tRun an i3 command. See http://i3wm.org/docs/userguide.html#_list_of_commands for a list of valid commands.
val get_workspaces : connection -> Reply.workspace list Lwt.tGet the list of current workspaces.
val get_outputs : connection -> Reply.output list Lwt.tGet the list of current outputs.
val get_tree : connection -> Reply.node Lwt.tGet the layout tree. i3 uses a tree data-structure to represent the layout of windows in a workspace.
val get_marks : connection -> Reply.mark list Lwt.tGet a list of marks (identifiers of containers).
val get_bar_ids : connection -> Reply.bar_id list Lwt.tGet the list of IDs of all configured bars.
val get_bar_config : connection -> Reply.bar_id -> Reply.bar_config Lwt.tGet the configuration of the workspace bar with given ID.
val get_version : connection -> Reply.version Lwt.tGet the version of i3.
val get_binding_modes : connection -> Reply.binding_modes Lwt.tGet binding modes of i3.
val get_config : connection -> Reply.config Lwt.tGet the config file as loaded by i3 most recently.
val send_tick : connection -> string -> bool Lwt.tSends a tick event with the specified payload.