6 <div id="content" class="usergen">
7 <h1>User-contributed article: enhanced and extensible i3bar with py3status</h1>
10 In the i3 documentation, the recommended tool for <a
11 href="https://i3wm.org/docs/userguide.html#_displaying_a_status_line">displaying
12 a status line is to use i3status</a> combined with i3bar.
16 While i3status is very efficient at what it does, it is, by design, fairly
17 limited to a few modules and does not allow not allow the users to add anything
18 to the i3bar. This was said pretty clearly on the i3status man page:
21 <pre><tt>*EXTERNAL SCRIPTS/PROGRAMS WITH I3STATUS
23 In i3status, we don’t want to implement process management again.
24 Therefore, there is no module to run arbitrary scripts or commands.
25 Instead, you should use your shell.
28 <h2>Introducing py3status</h2>
31 The goal of py3status is to fill this gap by allowing users to simply extend
32 their i3bar <b>while preserving their current i3status configuration</b>.
33 The main idea is to rely on i3status' strength without adding any configuration
34 on the user's side. py3status is thus a wrapper script for i3status and its
35 configuration as explained in the documentation below.
36 This should be said that py3status is much more than just a wrapper script.
39 <h2>Documentation</h2>
41 <p>View the full documentation now or bookmark it for later viewing:</p>
44 <a href="https://py3status.readthedocs.io/en/latest">Read the Docs</a>
47 <a href="https://github.com/ultrabug/py3status/tree/master/doc">Github</a>
51 <h2>Using py3status</h2>
53 <p>Using py3status has never been so easy. Update your i3 config with this and
57 status_command py3status
62 In other words, just replace <i>i3status</i> in your current
63 <b>status_command</b> by <i>py3status</i>.
66 <p>Py3status will look for status config file in this order.</p>
68 1 ~/.config/py3status/config
69 2 ~/.config/i3status/config
70 3 ~/.config/i3/i3status.conf
73 6 /etc/xdg/i3status/config
77 <p>Alternatively, you can start from scratch with an empty status config.</p>
80 status_command py3status -c ~/.config/py3status/config
84 <p>Learn more about how to configure py3status on the
85 <a href="https://py3status.readthedocs.io/en/latest/configuration.html">
86 configuration documentation</a>
89 <h2>Using py3status modules</h2>
91 <p>Like i3status, py3status comes with modules (but a lot of them!).</p>
92 <p>Learn more about the modules provided by py3status on the
93 <a href="https://py3status.readthedocs.io/en/latest/modules.html">modules
98 Like i3status, we can add and configure the modules the same way... usually in
99 the status config.</p>
101 <p>An excerpt from <span class="box">man 1 i3status</span>.</p>
102 <pre><tt>CONFIGURATION
104 The basic idea of i3status is that you can specify which "modules" should be
105 used (the order directive).
106 You can then configure each module with its own section. For every module,
107 you can specify the output format.
110 <p>A skeleton reference.</p>
112 order += "module_name"
118 <p>An example of using <span class="box">imap</span> module.</p>
122 order += "imap" <----
126 # add imap settings and open xterm with mutt on left-click
129 password = "ilovebugs"
131 server = "imap.mybugprovider.com"
133 on_click 1 = "exec xterm -e mutt"
137 <h2>Clicking the modules</h2>
140 Starting with <span class="box">version 2.0</span>, py3status allows the mouse
141 click events from the modules to be bound as options in the status config where
142 the users can configure what to do when they received the click events.
144 <p>It is possible to run commands, scripts, or programs with a click.</p>
145 <p>You can place the configuration parameter
146 <span class="box">on_click [button number] = "[command]"</span> in the module
149 Py3status will run the <span class="box">command</span> using
150 <span class="box">i3-msg</span> when the module's click event matches the
151 configured module section's click <span class="box">event</span>.</p>
153 <p>Quick reference:</p>
155 on_click [button number] = "[command]"
156 on_click 1 = "exec firefox" ----> i3-msg "exec firefox"
159 <p>Click events buttons reference:</p>
168 <p>Examples of using <span class="box">on_click</span> config:</p>
170 # reload i3 on left-click
171 # restart i3 on middle-click
173 on_click 1 = "reload"
174 on_click 2 = "restart"
177 # open wicd-gtk on left-click
178 # kill wicd-gtk on right-click
180 on_click 1 = "exec wicd-gtk"
181 on_click 3 = "exec killall wicd-gtk"
184 # open thunar on left-click
186 on_click 1 = "exec thunar"
189 # open firefox with an URL on left-click
190 weather_yahoo paris {
191 on_click 1 = "exec firefox http://www.my-favorite-weather-site.com/
195 <h2>Grouping the modules</h2>
198 The <span class="box">group</span> module allows you to group several modules
199 together to save space. Only one of the them will be displayed at a time.
202 The modules of a <span class="box">group</span> can either be cycled through
203 automatically or by user action (mouse scroll by default).
206 <p>An example of using the <span class="box">group</span> module with 3
207 different <span class="box">tztime</span> modules:</p>
211 # cycle through different timezone hours every 10s
218 timezone = "America/Los_Angeles"
223 timezone = "America/New_York"
228 timezone = "Asia/Dubai"
233 <h2>Writing new modules for py3status</h2>
236 <li>py3status utilizes an easy-to-use and straightforward system for its
238 <li>py3status contains an excellent set of useful functions to make writing
240 <li>py3status continues to grow healthy with well written documentation on the
241 modules, on the functions and parameters, on making new modules, and many more.
246 <a href="https://py3status.readthedocs.io/en/latest/writing_modules.html">write
247 (and contribute please!) your own modules!</a></p>