]> git.sur5r.net Git - i3/i3.github.io/blob - docs/wsbar.html
update /docs for 4.3
[i3/i3.github.io] / docs / wsbar.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
2     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
4 <head>\r
5 <link rel="icon" type="image/png" href="/favicon.png">\r
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
7 <meta name="generator" content="AsciiDoc 8.6.7" />\r
8 <title>i3: External workspace bars</title>\r
9 <link rel="stylesheet" href="/css/style.css" type="text/css" />\r
10 <link rel="stylesheet" href="/css/xhtml11.css" type="text/css" />\r
11 <script type="text/javascript">\r
12 /*<![CDATA[*/\r
13 window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}\r
14 /*]]>*/\r
15 </script>\r
16 <script type="text/javascript" src="/js/asciidoc-xhtml11.js"></script>\r
17 </head>\r
18 <body class="article">\r
19 \r
20         <div id="main">\r
21             <a href="/"><h1 id="title">i3 - improved tiling WM</h1></a>\r
22                         <ul id="nav">\r
23                                 <li><a style="border-bottom: 2px solid #fff" href="/docs">Docs</a></li>\r
24                                 <li><a href="/screenshots">Screens</a></li>\r
25                                 <li><a href="/contact">Contact</a></li>\r
26                                 <li><a href="http://bugs.i3wm.org/">Bugs</a></li>\r
27                         </ul>\r
28         <br style="clear: both">\r
29 <div id="content">\r
30 <div id="header">\r
31 <h1>External workspace bars</h1>\r
32 <span id="author">Michael Stapelberg</span><br />\r
33 <span id="email"><tt>&lt;<a href="mailto:michael+i3@stapelberg.de">michael+i3@stapelberg.de</a>&gt;</tt></span><br />\r
34 <span id="revdate">May 2010</span>\r
35 <div id="toc">
36   <div id="toctitle">Table of Contents</div>
37   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
38 </div>\r
39 </div>\r
40 <div id="preamble">\r
41 <div class="sectionbody">\r
42 <div class="paragraph"><p>This document describes why the internal workspace bar is minimal and how an\r
43 external workspace bar can be used. It explains the concepts using <tt>i3-wsbar</tt>\r
44 as the reference implementation.</p></div>\r
45 </div>\r
46 </div>\r
47 <div class="sect1">\r
48 <h2 id="_internal_and_external_bars">1. Internal and external bars</h2>\r
49 <div class="sectionbody">\r
50 <div class="paragraph"><p>The internal workspace bar of i3 is meant to be a reasonable default so that\r
51 you can use i3 without having too much hassle when setting it up. It is quite\r
52 simple and intended to stay this way. So, there is no way to display your own\r
53 information in this bar (unlike dwm, wmii, awesome, …).</p></div>\r
54 <div class="paragraph"><p>We chose not to implement such a mechanism because that would be duplicating\r
55 already existing functionality of tools such as dzen2, xmobar and similar.\r
56 Instead, you should disable the internal bar and use an external workspace bar\r
57 (which communicates with i3 through its IPC interface).</p></div>\r
58 </div>\r
59 </div>\r
60 <div class="sect1">\r
61 <h2 id="_dock_mode">2. dock mode</h2>\r
62 <div class="sectionbody">\r
63 <div class="paragraph"><p>You typically want to see the same workspace bar on every workspace on a\r
64 specific screen. Also, you don’t want to place the workspace bar somewhere\r
65 in your layout by hand. This is where dock mode comes in: When a program sets\r
66 the appropriate hint (_NET_WM_WINDOW_TYPE_DOCK), it will be managed in dock\r
67 mode by i3. That means it will be placed at the bottom of the screen (while\r
68 other edges of the screen are possible in the NetWM standard, this is not yet\r
69 implemented in i3), it will not overlap any other window and it will be on\r
70 every workspace for the specific screen it was placed on initially.</p></div>\r
71 </div>\r
72 </div>\r
73 <div class="sect1">\r
74 <h2 id="_the_ipc_interface">3. The IPC interface</h2>\r
75 <div class="sectionbody">\r
76 <div class="paragraph"><p>In the context of using an external workspace bar, the IPC interface needs to\r
77 provide the bar program with the current workspaces and output (as in VGA-1,\r
78 LVDS-1, …) configuration. In the other direction, the program has to be able\r
79 to switch to specific workspaces.</p></div>\r
80 <div class="paragraph"><p>By default, the IPC interface is enabled and places its UNIX socket in\r
81 <tt>~/.i3/ipc.sock</tt>.</p></div>\r
82 <div class="paragraph"><p>To learn more about the protocol which is used for IPC, see <tt>docs/ipc</tt>.</p></div>\r
83 </div>\r
84 </div>\r
85 <div class="sect1">\r
86 <h2 id="_output_changes_on_the_fly">4. Output changes (on-the-fly)</h2>\r
87 <div class="sectionbody">\r
88 <div class="paragraph"><p>i3 implements the RandR API and can handle changing outputs quite well. So, an\r
89 external workspace bar implementation needs to make sure that when you change\r
90 the resolution of any of your screens (or enable/disable an output), the bars\r
91 will be adjusted properly.</p></div>\r
92 </div>\r
93 </div>\r
94 <div class="sect1">\r
95 <h2 id="_i3_wsbar_the_reference_implementation">5. i3-wsbar, the reference implementation</h2>\r
96 <div class="sectionbody">\r
97 <div class="paragraph"><p>Please keep in mind that <tt>i3-wsbar</tt> is just a reference implementation. It is\r
98 shipped with i3 to have a reasonable default. Thus, <tt>i3-wsbar</tt> is designed to\r
99 work well with dzen2 and there are no plans to make it more generic.</p></div>\r
100 <div class="sect2">\r
101 <h3 id="_the_big_picture">5.1. The big picture</h3>\r
102 <div class="paragraph"><p>The most common reason to use an external workspace bar is to integrate system\r
103 information such as what <tt>i3status</tt> provides into the workspace bar (to save\r
104 screen space). So, we have <tt>i3status</tt> or a similar program, which only provides\r
105 text output (formatted in some way). To display this text nicely on the screen,\r
106 there are programs such as dzen2, xmobar and similar. We will stick to dzen2\r
107 from here on. So, we have the output of i3status, which needs to go into dzen2\r
108 somehow. But we also want to display the list of workspaces. <tt>i3-wsbar</tt> takes\r
109 input on stdin, combines it with a formatted workspace list and pipes it to\r
110 dzen2.</p></div>\r
111 <div class="paragraph"><p>Please note that <tt>i3-wsbar</tt> does not print its output to stdout. Instead, it\r
112 launches the dzen2 instances on its own. This is necessary to handle changes\r
113 in the available outputs (to place a new dzen2 on a new screen for example).</p></div>\r
114 <div class="paragraph"><p><span class="image">\r
115 <a class="image" href="wsbar.png">\r
116 <img src="wsbar.png" alt="Overview" />\r
117 </a>\r
118 </span></p></div>\r
119 </div>\r
120 <div class="sect2">\r
121 <h3 id="_running_i3_wsbar">5.2. Running i3-wsbar</h3>\r
122 <div class="paragraph"><p>The most simple usage of i3-wsbar looks like this:</p></div>\r
123 <div class="listingblock">\r
124 <div class="content">\r
125 <pre><tt>i3-wsbar -c "dzen2 -x %x -dock"</tt></pre>\r
126 </div></div>\r
127 <div class="paragraph"><p>The <tt>%x</tt> in the command name will be replaced by the X position of the output\r
128 for which this workspace bar is running. i3 will automatically place the\r
129 workspace bar on the correct output when dzen2 is started in dock mode. The\r
130 bar which you will see should look exactly like the internal bar of i3.</p></div>\r
131 <div class="paragraph"><p>To actually get a benefit, you want to give <tt>i3-wsbar</tt> some input:</p></div>\r
132 <div class="listingblock">\r
133 <div class="content">\r
134 <pre><tt>i3status | i3-wsbar -c "dzen2 -x %x -dock"</tt></pre>\r
135 </div></div>\r
136 <div class="paragraph"><p>It is recommended to place the above command in your i3 configuration file\r
137 to start it automatically with i3.</p></div>\r
138 </div>\r
139 </div>\r
140 </div>\r
141 </div>\r
142 <div id="footnotes"><hr /></div>\r
143 <div id="footer" lang="de">\r
144 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
145 </div>\r
146 </body>\r
147 </html>\r