chickadee » i3 » cmd

cmd conn msg #!optional (type 0)procedure

Sends the given MSG to i3, by default as command.

conn
A connection to i3, created with (connect).
msg
The payload of the message, e.g. a command when type is 0.
type
The numeric message type, “COMMAND” (0) by default. See also http://i3wm.org/docs/ipc.html#_sending_messages_to_i3 for message types.
(define (cmd conn msg #!optional (type 0))
  (let ((sock (i3-conn-cmd-fd conn)))
    (socket-send-all sock (i3-format-ipc-message msg type))
    (i3-read-one-message sock)))