]> git.sur5r.net Git - i3/i3.github.io/commitdiff
update ipc docs
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 3 Oct 2012 22:00:35 +0000 (00:00 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 3 Oct 2012 22:00:35 +0000 (00:00 +0200)
_docs/ipc
docs/ipc.html

index f8dfa78e4ca0fdb117f0dd4b79365cd98bdba850..6bdccd0b650c4629df430fc760a01d2f1ba3780d 100644 (file)
--- a/_docs/ipc
+++ b/_docs/ipc
@@ -1,7 +1,7 @@
 IPC interface (interprocess communication)
 ==========================================
 Michael Stapelberg <michael@i3wm.org>
 IPC interface (interprocess communication)
 ==========================================
 Michael Stapelberg <michael@i3wm.org>
-August 2012
+October 2012
 
 This document describes how to interface with i3 from a separate process. This
 is useful for example to remote-control i3 (to write test cases for example) or
 
 This document describes how to interface with i3 from a separate process. This
 is useful for example to remote-control i3 (to write test cases for example) or
@@ -19,6 +19,13 @@ calling +i3 --get-socketpath+.
 All i3 utilities, like +i3-msg+ and +i3-input+ will read the +I3_SOCKET_PATH+
 X11 property, stored on the X11 root window.
 
 All i3 utilities, like +i3-msg+ and +i3-input+ will read the +I3_SOCKET_PATH+
 X11 property, stored on the X11 root window.
 
+[WARNING]
+.Use an existing library!
+There are existing libraries for many languages. You can have a look at
+<<libraries>> or search the web if your language of choice is not mentioned.
+Usually, it is not necessary to implement low-level communication with i3
+directly.
+
 == Establishing a connection
 
 To establish a connection, simply open the IPC socket. The following code
 == Establishing a connection
 
 To establish a connection, simply open the IPC socket. The following code
@@ -82,7 +89,7 @@ So, a typical message could look like this:
 Or, as a hexdump:
 ------------------------------------------------------------------------------
 00000000  69 33 2d 69 70 63 04 00  00 00 00 00 00 00 65 78  |i3-ipc........ex|
 Or, as a hexdump:
 ------------------------------------------------------------------------------
 00000000  69 33 2d 69 70 63 04 00  00 00 00 00 00 00 65 78  |i3-ipc........ex|
-00000010  69 74 0a                                          |it.|
+00000010  69 74                                             |it|
 ------------------------------------------------------------------------------
 
 To generate and send such a message, you could use the following code in Perl:
 ------------------------------------------------------------------------------
 
 To generate and send such a message, you could use the following code in Perl:
@@ -274,6 +281,8 @@ name (string)::
 border (string)::
        Can be either "normal", "none" or "1pixel", dependending on the
        container’s border style.
 border (string)::
        Can be either "normal", "none" or "1pixel", dependending on the
        container’s border style.
+current_border_width (integer)::
+       Number of pixels of the border width.
 layout (string)::
        Can be either "splith", "splitv", "stacked", "tabbed", "dockarea" or
        "output".
 layout (string)::
        Can be either "splith", "splitv", "stacked", "tabbed", "dockarea" or
        "output".
@@ -610,6 +619,8 @@ workspace (0)::
 output (1)::
        Sent when RandR issues a change notification (of either screens,
        outputs, CRTCs or output properties).
 output (1)::
        Sent when RandR issues a change notification (of either screens,
        outputs, CRTCs or output properties).
+mode (2)::
+       Sent whenever i3 changes its binding mode.
 
 *Example:*
 --------------------------------------------------------------------
 
 *Example:*
 --------------------------------------------------------------------
@@ -651,7 +662,21 @@ This event consists of a single serialized map containing a property
 { "change": "unspecified" }
 ---------------------------
 
 { "change": "unspecified" }
 ---------------------------
 
-== See also
+=== mode event
+
+This event consists of a single serialized map containing a property
++change (string)+ which holds the name of current mode in use. The name
+is the same as specified in config when creating a mode. The default
+mode is simply named default.
+
+*Example:*
+---------------------------
+{ "change": "default" }
+---------------------------
+
+== See also (existing libraries)
+
+[[libraries]]
 
 For some languages, libraries are available (so you don’t have to implement
 all this on your own). This list names some (if you wrote one, please let me
 
 For some languages, libraries are available (so you don’t have to implement
 all this on your own). This list names some (if you wrote one, please let me
index 4b20c01ca672a4d7ac187610cc1835bc0e1fc84f..0459e526fa0b3c766f0e7db3c3856e4a175ac11d 100644 (file)
@@ -31,7 +31,7 @@ window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}
 <h1>IPC interface (interprocess communication)</h1>\r
 <span id="author">Michael Stapelberg</span><br />\r
 <span id="email"><tt>&lt;<a href="mailto:michael@i3wm.org">michael@i3wm.org</a>&gt;</tt></span><br />\r
 <h1>IPC interface (interprocess communication)</h1>\r
 <span id="author">Michael Stapelberg</span><br />\r
 <span id="email"><tt>&lt;<a href="mailto:michael@i3wm.org">michael@i3wm.org</a>&gt;</tt></span><br />\r
-<span id="revdate">August 2012</span>\r
+<span id="revdate">October 2012</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -52,6 +52,18 @@ filename character set (see mkdtemp(3)). You can get the socketpath from i3 by
 calling <tt>i3 --get-socketpath</tt>.</p></div>\r
 <div class="paragraph"><p>All i3 utilities, like <tt>i3-msg</tt> and <tt>i3-input</tt> will read the <tt>I3_SOCKET_PATH</tt>\r
 X11 property, stored on the X11 root window.</p></div>\r
 calling <tt>i3 --get-socketpath</tt>.</p></div>\r
 <div class="paragraph"><p>All i3 utilities, like <tt>i3-msg</tt> and <tt>i3-input</tt> will read the <tt>I3_SOCKET_PATH</tt>\r
 X11 property, stored on the X11 root window.</p></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Warning</div>\r
+</td>\r
+<td class="content">\r
+<div class="title">Use an existing library!</div>There are existing libraries for many languages. You can have a look at\r
+<a href="#libraries">[libraries]</a> or search the web if your language of choice is not mentioned.\r
+Usually, it is not necessary to implement low-level communication with i3\r
+directly.</td>\r
+</tr></table>\r
+</div>\r
 </div>\r
 </div>\r
 <div class="sect1">\r
 </div>\r
 </div>\r
 <div class="sect1">\r
@@ -167,7 +179,7 @@ GET_VERSION (7)
 <div class="listingblock">\r
 <div class="content">\r
 <pre><tt>00000000  69 33 2d 69 70 63 04 00  00 00 00 00 00 00 65 78  |i3-ipc........ex|\r
 <div class="listingblock">\r
 <div class="content">\r
 <pre><tt>00000000  69 33 2d 69 70 63 04 00  00 00 00 00 00 00 65 78  |i3-ipc........ex|\r
-00000010  69 74 0a                                          |it.|</tt></pre>\r
+00000010  69 74                                             |it|</tt></pre>\r
 </div></div>\r
 <div class="paragraph"><p>To generate and send such a message, you could use the following code in Perl:</p></div>\r
 <div class="listingblock">\r
 </div></div>\r
 <div class="paragraph"><p>To generate and send such a message, you could use the following code in Perl:</p></div>\r
 <div class="listingblock">\r
@@ -495,6 +507,14 @@ border (string)
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+current_border_width (integer)\r
+</dt>\r
+<dd>\r
+<p>\r
+        Number of pixels of the border width.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 layout (string)\r
 </dt>\r
 <dd>\r
 layout (string)\r
 </dt>\r
 <dd>\r
@@ -1059,6 +1079,14 @@ output (1)
         outputs, CRTCs or output properties).\r
 </p>\r
 </dd>\r
         outputs, CRTCs or output properties).\r
 </p>\r
 </dd>\r
+<dt class="hdlist1">\r
+mode (2)\r
+</dt>\r
+<dd>\r
+<p>\r
+        Sent whenever i3 changes its binding mode.\r
+</p>\r
+</dd>\r
 </dl></div>\r
 <div class="paragraph"><p><strong>Example:</strong></p></div>\r
 <div class="listingblock">\r
 </dl></div>\r
 <div class="paragraph"><p><strong>Example:</strong></p></div>\r
 <div class="listingblock">\r
@@ -1101,12 +1129,24 @@ if ($is_event) {
 <pre><tt>{ "change": "unspecified" }</tt></pre>\r
 </div></div>\r
 </div>\r
 <pre><tt>{ "change": "unspecified" }</tt></pre>\r
 </div></div>\r
 </div>\r
+<div class="sect2">\r
+<h3 id="_mode_event">4.5. mode event</h3>\r
+<div class="paragraph"><p>This event consists of a single serialized map containing a property\r
+<tt>change (string)</tt> which holds the name of current mode in use. The name\r
+is the same as specified in config when creating a mode. The default\r
+mode is simply named default.</p></div>\r
+<div class="paragraph"><p><strong>Example:</strong></p></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>{ "change": "default" }</tt></pre>\r
+</div></div>\r
+</div>\r
 </div>\r
 </div>\r
 <div class="sect1">\r
 </div>\r
 </div>\r
 <div class="sect1">\r
-<h2 id="_see_also">5. See also</h2>\r
+<h2 id="_see_also_existing_libraries">5. See also (existing libraries)</h2>\r
 <div class="sectionbody">\r
 <div class="sectionbody">\r
-<div class="paragraph"><p>For some languages, libraries are available (so you don’t have to implement\r
+<div class="paragraph" id="libraries"><p>For some languages, libraries are available (so you don’t have to implement\r
 all this on your own). This list names some (if you wrote one, please let me\r
 know):</p></div>\r
 <div class="dlist"><dl>\r
 all this on your own). This list names some (if you wrote one, please let me\r
 know):</p></div>\r
 <div class="dlist"><dl>\r