{ "success": true }+
X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=docs%2Fipc.html;h=12d7fe831479039151dfd92a5004f60d9d4f6a91;hb=6176c0889b1da4eb1e71dfbb54fee3f48f9781fd;hp=34a55eaf82ac70a6b11b9509f6e6be4b59b23250;hpb=167cbbbaee792decb0c501767d9ce402df2afad3;p=i3%2Fi3.github.io diff --git a/docs/ipc.html b/docs/ipc.html index 34a55ea..12d7fe8 100644 --- a/docs/ipc.html +++ b/docs/ipc.html @@ -4,7 +4,7 @@
- +Returns the last loaded i3 config.
10
SEND_TICK
Sends a tick event with the specified payload.
11
SYNC
Sends an i3 sync event with the specified random value to the specified window.
+ Reply to the SEND_TICK message. +
++ X11 window properties title, instance, class, window_role and transient_for. +
+{ "config": "font pango:monospace 8\nbindsym Mod4+q exit\n" }
The reply is a map containing the "success" member. After the reply was +received, the tick event has been written to all IPC connections which subscribe +to tick events. UNIX sockets are usually buffered, but you can be certain that +once you receive the tick event you just triggered, you must have received all +events generated prior to the SEND_TICK message (happened-before relation).
Example:
{ "success": true }+
The reply is a map containing the "success" member. After the reply was +received, the i3 sync message was +responded to.
Example:
{ "success": true }+
If an event message needs to be sent and the socket is not writeable (write +returns EAGAIN, happens when the socket doesn’t have enough buffer space for +writing new data) then i3 uses a queue system to store outgoing messages for +each client. This is combined with a timer: if the message queue for a client is +not empty and no data where successfully written in the past 10 seconds, the +connection is killed. Practically, this means that your client should try to +always read events from the socket to avoid having its connection closed.
By sending a message of type SUBSCRIBE with a JSON-encoded array as payload @@ -1282,6 +1347,16 @@ shutdown (6) Sent when the ipc shuts down because of a restart or exit by user command
++ Sent when the ipc client subscribes to the tick event (with "first": + true) or when any ipc client sends a SEND_TICK message (with "first": + false). +
+Example:
This event is triggered by a subscription to tick events or by a SEND_TICK +message.
Example (upon subscription):
{ + "first": true, + "payload": "" +}+
Example (upon SEND_TICK with a payload of arbitrary string):
{ + "first": false, + "payload": "arbitrary string" +}+
https://github.com/whitelynx/i3ipc (not maintained)
Find an example implementation of this technique in +https://github.com/i3/go-i3/blob/master/byteorder.go