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="http://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 limited to
17 a few modules and does not allow you to inject your own scripts output on your
18 i3bar. This is said pretty clearly on the i3status man page:
21 <pre><tt>In i3status, we don’t want to implement process management again.
22 Therefore, there is no module to run arbitrary scripts or commands.
23 Instead, you should use your shell.</tt></pre>
25 <h2>Introducing py3status</h2>
28 The goal of py3status is to fill this gap by allowing users to simply extend
29 their i3bar while preserving their current i3status configuration. The main idea
30 is to rely on i3status' strength without adding any configuration on the user's
31 side. py3status is thus a wrapper script for i3status and its configuration as
32 explained <a href="https://github.com/ultrabug/py3status/wiki">on the wiki</a>.
38 Using py3status is easy, no need to multi-pipe your scripts after i3status.
39 Instead just replace <i>i3status</i> in your current <b>status_command</b> by
41 For example, if your current status_command in your i3 config file resides in
42 ~/.i3/i3status.conf, you would change your i3 config to this:
45 <pre><tt>status_command py3status -c ~/.i3/i3status.conf</tt></pre>
47 <h2>Handle i3bar click events from your i3status.conf</h2>
50 Py3status (since v2) is also wrapping and extending your i3status.conf and
51 allows you directly handle all the i3bar click events on any of your configured
52 modules whether they are i3status modules or py3status modules.
56 To do so, all you have to do is add a new configuration parameter named
57 <b>on_click [button number]</b> to your module config and py3status will then
58 execute the given i3 command (using i3-msg). This means you can run simple
59 tasks like executing a program or execute any other i3 specific command.
61 <p>Some examples below from i3status.conf:</p>
64 # reload the i3 config when I left click on the i3status time module
65 # and restart i3 when I middle click on it
68 on_click 2 = "restart"
71 # run wicd-gtk GUI when I left click on the i3status ethernet module
72 # and kill it when I right click on it
74 # if you use %speed, i3status requires root privileges
77 on_click 1 = "exec wicd-gtk"
78 on_click 3 = "exec killall wicd-gtk"
81 # run thunar when I left click on the / disk info module
84 on_click 1 = "exec thunar /"
87 # open an URL on opera when I left click on the py3status weather_yahoo module
90 city_code = "FRXX0076"
92 on_click 1 = "exec opera http://www.meteo.fr"
97 <h2>Use py3status modules in your i3bar</h2>
100 Py3status (since v2) also comes with some configurable modules you can load and
101 configure directly from your i3status.conf just like any other i3status module.
103 href="https://github.com/ultrabug/py3status/tree/master/py3status/modules">You
104 can see the list of the modules and their configuration parameters here.</a>
108 To load a py3status module you just have to list it like any other i3status
109 module using the <b>order +=</b> parameter. For example you could insert and
110 load the imap module like this:
114 order += "disk /home"
120 <p>And then you could configure it like this:</p>
123 # configure the py3status imap module
124 # and run thunderbird when I left click on it
127 imap_server = 'imap.myprovider.com'
133 on_click 1 = "exec thunderbird"
138 <h2>Write your own modules to display your own stuff</h2>
141 Py3status features a simple and straightforward module system which you can use
142 to get your own output displayed on your i3bar. You can read more and view some
144 href="https://github.com/ultrabug/py3status/wiki/Write-your-own-modules"> on the
148 <h2>Documentation</h2>
151 You can read the full and up to date documentation on the <a
152 href="https://github.com/ultrabug/py3status">py3status home page</a>.