package i3ipc

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module I3ipcSource

A pure OCaml implementation of the i3 IPC protocol.

Sourcetype protocol_error =
  1. | No_IPC_socket
  2. | Bad_magic_string of string
  3. | Unexpected_eof
  4. | Unknown_type of Stdint.Uint32.t
  5. | Bad_reply of string

The different errors that may be raised.

Sourceval pp_protocol_error : Format.formatter -> protocol_error -> unit
Sourceexception Protocol_error of protocol_error
Sourcemodule Reply : sig ... end

Type definitions for the command replies.

Sourcemodule Event : sig ... end

Type definitions for the events that can be subscribed to.

Connection to i3

Sourcetype connection

Type describing a connection to the i3 IPC endpoint.

Sourceval connect : unit -> connection Lwt.t

Connect to a running i3 instance.

Sourceval disconnect : connection -> unit Lwt.t

Close a connection.

Event subscription

Sourcetype subscription =
  1. | Workspace
  2. | Output
  3. | Mode
  4. | Window
  5. | BarConfig
  6. | Binding
  7. | Shutdown
  8. | Tick

Subscribe to certain events.

Sourceval next_event : connection -> Event.t Lwt.t

Wait for the next event, among those subscribed to.

Commands and queries

Sourceval command : connection -> string -> Reply.command_outcome list Lwt.t

Run an i3 command. See http://i3wm.org/docs/userguide.html#_list_of_commands for a list of valid commands.

Sourceval get_workspaces : connection -> Reply.workspace list Lwt.t

Get the list of current workspaces.

Sourceval get_outputs : connection -> Reply.output list Lwt.t

Get the list of current outputs.

Get the layout tree. i3 uses a tree data-structure to represent the layout of windows in a workspace.

Sourceval get_marks : connection -> Reply.mark list Lwt.t

Get a list of marks (identifiers of containers).

Sourceval get_bar_ids : connection -> Reply.bar_id list Lwt.t

Get the list of IDs of all configured bars.

Get the configuration of the workspace bar with given ID.

Sourceval get_version : connection -> Reply.version Lwt.t

Get the version of i3.

Sourceval get_binding_modes : connection -> Reply.binding_modes Lwt.t

Get binding modes of i3.

Sourceval get_config : connection -> Reply.config Lwt.t

Get the config file as loaded by i3 most recently.

Sourceval send_tick : connection -> string -> bool Lwt.t

Sends a tick event with the specified payload.

OCaml

Innovation. Community. Security.