]> git.sur5r.net Git - i3/i3.github.io/blob - docs/4.13/user-contributed/lzap-config.html
save docs for 4.13
[i3/i3.github.io] / docs / 4.13 / user-contributed / lzap-config.html
1 ---
2 layout: default
3 title: Docs
4 group: Docs
5 ---
6 <div id="content" class="usergen">
7 <h1>User-contributed article: Lukáš Zapletal’s i3 configuration</h1>
8
9 <p>I was keeping sight on i3 for some time after I saw Michael&#8217;s <a href='http://www.youtube.com/watch?v=QnYN2CTb1hM'>presentation at Google</a> the other day. Last weekend, I upgraded my Fedora 17 and when I noticed i3 version 4.2 in the repositories, I gave it a try. First of all, I have to admit I&#8217;ve fallen in love. Totally.</p>
10
11 <p>It&#8217;s a tiling window manager which is lightweight yet powerful. What I like about i3 is ease of adopting it. Michael, the main author of this awesome software, made the default configuration very sane. And i3 is also very fast by it&#8217;s (UNIX) design. Last but not least, i3 saves every pixel on the screen. You can get the most from your screen(s). And yes - it <em>does</em> support multiple screens very nicely.</p>
12
13 <p>Instead of describing how it looks like when you use i3, I&#8217;d rather publish my (pretty new) configuration describing each line of it. Before I start, I need to highlight one thing. It&#8217;s a <strong>tiling</strong> window manager. You manage windows into tiles, it&#8217;s the basic idea. While you can turn windows into &#8220;normal&#8221; (the correct term is &#8220;floating&#8221;) mode, you loose lots of things and this is not the mode you want to work in. It is mainly used by i3 for dialogs, tooltips or other temporary windows.</p>
14
15 <h2 id='installation'>Installation</h2>
16
17 <p>Is pretty straightforward. We need i3 itself and several other highly recommended apps I will describe later. In short: simple screen locker, starter menu and simple notification daemon.</p>
18
19 <pre><tt># yum -y install i3 i3lock dmenu dunst</tt></pre>
20
21 <p>Please note dunst is not in Fedora 17 repositories, but I have created a <a href='https://bugzilla.redhat.com/show_bug.cgi?id=852211'>review request</a>. Feel free to take it for review.</p>
22
23 <p>Exit your desktop environment or window manager and log on into i3 from the GDM menu (if you use it). i3 will ask to create initial configuration during the first start. Say yes and do not worry - reloading/restarting i3 is fluent and you can do this zillions of times without loosing a single window.</p>
24
25 <h2 id='i3_configuration'>i3 configuration</h2>
26
27 <p>Configuration is located in <strong>.i3/config</strong>. Let&#8217;s do the walkthrough.</p>
28
29 <pre><tt>set $mod Mod4</tt></pre>
30
31 <p>i3 works best with a modifier key set to ALT (Mod1) or WIN (Mod4). I have a windows key on my keyboard unused anyway, so I use it as my main modifier key (with few exceptions bellow).</p>
32
33 <pre><tt># font for window titles. ISO 10646 = Unicode
34 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1</tt></pre>
35
36 <p>Basic font for windows titles. I was experimenting with my favourite one - Terminus - but the default (misc-fixed) works great and is narrower.</p>
37
38 <pre><tt># Use Mouse+$mod to drag floating windows to their wanted position
39 floating_modifier $mod</tt></pre>
40
41 <p>By default windows has 1 pixel border, so it&#8217;s difficult to resize them with mouse. With this option, you can <em>move</em> windows with modifier + left click and <em>resize</em> with modifier + right click. I bet Apple patented this already, but who cares.</p>
42
43 <pre><tt># start a terminal
44 bindsym $mod+Return exec i3-sensible-terminal</tt></pre>
45
46 <p>I am starting terminals a lot. Like fifty a day, or even more. Michael&#8217;s default configuration has this binding and I keep it. By the way i3 has several i3-* scripts (three I guess) which tries to find &#8220;the best&#8221; terminal (editor etc). In my case its urxvt and vim, but i3-* will find out from ENV variables of course.</p>
47
48 <pre><tt># kill focused window
49 bindsym $mod+Shift+Q kill</tt></pre>
50
51 <p>As you will notice shortly, i3 does not draw any minimize, maximize and close buttons. Except the latter, they are useless. It turns out every single application has an exit path (usually using Ctrl+q or something like that), so you don&#8217;t need the [X] button. Few apps do not support it (like very old xev), you can use this shortcut that tries to close it nicely first and it kills it if it does not work.</p>
52
53 <pre><tt># start dmenu (a program launcher)
54 bindsym $mod+d exec dmenu_run</tt></pre>
55
56 <p>Do you think there is a start menu or icons on a desktop in i3? Well, it&#8217;s a window manager. Of course not. By default it uses excellent dmenu starter and this simple wrapper that ships with it. Basically, it makes a cache of all executable applications and shows them while you type in a top bar. It&#8217;s fast. It&#8217;s awesome.</p>
57
58 <pre><tt># reload/restart/exit
59 bindsym $mod+Shift+C reload
60 bindsym $mod+Shift+R restart
61 bindsym $mod+Shift+E exit</tt></pre>
62
63 <p>Few default key bindings you will like when playing with configuration.</p>
64
65 <pre><tt># screen locker (first move to &quot;safe&quot; workspace without any chat app)
66 bindsym Control+Mod1+l exec i3-msg workspace 1 &amp;&amp; i3lock -c 111111 -d</tt></pre>
67
68 <p>My invention here. Locking a screen is an easy task, but unlocking it without providing your password to other team folks via IRC channel is a challenge (for a guy in the <a href='http://pulpproject.org'>Pulp team</a> ;-) therefore I switch to the first workspace first where is <em>not</em> my IRC chat. Ever. I have to admit the issue is more when you don&#8217;t have your screen lock, but it was fun to create this key.</p>
69
70 <p>Please note i3lock built into Fedora 17 does <em>NOT</em> support loading of images. The software itself is capable of loading images instead of solid color, but this feature was not built. Just stick with a solid color for now.</p>
71
72 <p>By the way, you just saw i3-msg command which is distributed with i3 distribution. Every single command you see here in the bindsym and exec statements can be sent to i3 using i3-msg. You can create shell scripts with starting up applications, moving them around, changing workspaces and I can&#8217;t possibly imagine what can you do with it. Everything.</p>
73
74 <pre><tt># change focus
75 bindsym $mod+j focus left
76 bindsym $mod+k focus down
77 bindsym $mod+l focus up
78 bindsym $mod+semicolon focus right
79 #bindsym $mod+uring focus right</tt></pre>
80
81 <p>Default configuration for moving around. Notice this is not exactly what we know from Vim (its HJKL there). I thought I will hate it, but I got used to it in two hours. The commented line is for Czech keyboard layout (there is u with ring instead of semicolon) - ignore it if you don&#8217;t use this one.</p>
82
83 <pre><tt># alternatively, you can use the cursor keys:
84 bindsym $mod+Left focus left
85 bindsym $mod+Down focus down
86 bindsym $mod+Up focus up
87 bindsym $mod+Right focus right</tt></pre>
88
89 <p>I sometimes use arrow keys, usually when I don&#8217;t have my hands in the working position. It is likely when I eat :-)</p>
90
91 <pre><tt># move focused window
92 bindsym $mod+Shift+J move left
93 bindsym $mod+Shift+K move down
94 bindsym $mod+Shift+L move up
95 bindsym $mod+Shift+colon move right</tt></pre>
96
97 <p>Moving windows around is so simple with tiling managers. Just hold shift and you drag the window there.</p>
98
99 <pre><tt># alternatively, you can use the cursor keys:
100 bindsym $mod+Shift+Left move left
101 bindsym $mod+Shift+Down move down
102 bindsym $mod+Shift+Up move up
103 bindsym $mod+Shift+Right move right</tt></pre>
104
105 <p>I don&#8217;t use this with arrow keys, but it&#8217;s defined by default. Why not.</p>
106
107 <pre><tt># split in horizontal orientation
108 bindsym $mod+h split h
109
110 # split in vertical orientation
111 bindsym $mod+v split v</tt></pre>
112
113 <p>This is important. By default i3 splits the screen according to the screen size. For wide screens it&#8217;s usually horizontal split. You can configure this behavior if you want, but sometimes you want to split different way. That is what these bindings are for. i3 remembers that for the workspace, so you can split multiple windows easily.</p>
114
115 <pre><tt># enter fullscreen mode for the focused container
116 bindsym $mod+f fullscreen</tt></pre>
117
118 <p>Fullscreen is something you don&#8217;t use many times with standard window managers, but in tiling mode it is pretty useful. I use it a lot when I wan&#8217;t to &#8220;zoom in&#8221; a window.</p>
119
120 <pre><tt># change container layout (stacked, tabbed, default)
121 bindsym $mod+s layout stacking
122 bindsym $mod+w layout tabbed
123 bindsym $mod+e layout default</tt></pre>
124
125 <p>Unique feature of i3, I would say. Best thing what you can do is to <a href='http://i3wm.org/docs/userguide.html#_changing_the_container_layout'>see a picture</a>. You can switch from tiling (default) to tabbed and stacking mode. You can have multiple Firefox instances in windows tabs if you want to. By the way, the i3 User&#8217;s Guide is the definitive document you want to read twice.</p>
126
127 <pre><tt># toggle tiling / floating
128 bindsym $mod+Shift+space floating toggle</tt></pre>
129
130 <p>Some applications does not work well in the tiling mode, because all windows are maximalized by default and according to your screen size and number of other containers there first application can be quite stretched. If your application looks weird, you can always switch to the floating (&#8220;normal&#8221;) mode, and back and forth with this key mapping. By default, i3 recognizes dialogs and tool windows, so you do not to switch all windows. Actually I had to switch only one application by now.</p>
131
132 <pre><tt># change focus between tiling / floating windows
133 bindsym $mod+space focus mode_toggle</tt></pre>
134
135 <p>If you have multiple windows in tiling and floating mode, you want to switch between those two groups. You do it with this key.</p>
136
137 <pre><tt># focus the parent container
138 #bindsym $mod+a focus parent
139
140 # focus the child container
141 #bindcode $mod+d focus child</tt></pre>
142
143 <p>I have to admit I never used this, because I try to keep number of windows on each workspace low (up to 6 I would say). It moves focus to parent or child window, perhaps more usable with more windows. Share your experiences with this. Notice it&#8217;s disabled because I use mod+d for the dmenu.</p>
144
145 <pre><tt># next/previous workspace
146 bindsym Mod1+Tab focus right
147 bindsym Mod1+Shift+Tab focus left
148 bindsym $mod+Tab workspace back_and_forth</tt></pre>
149
150 <p>This is not standard binding, but I find Alt+Tab pretty useful combination. It&#8217;s handy (I use my right hand for mouse) and it was not used by i3. So I started using it for cycling through windows on one workspace. If you have various (horizontal and vertical splits), it does not cycle through all of them. It&#8217;s only moving in vertical movement (right - left). I wish there has been a option like &#8220;focus cycle&#8221; in the next i3 version.</p>
151
152 <p>Shift does the other way around while Win+Tab switches to the last used weapon. Sorry, I said weapon? I mean workspace.</p>
153
154 <pre><tt># switch to workspace
155 bindsym $mod+ampersand workspace 1
156 bindsym $mod+eacute workspace 2
157 bindsym $mod+quotedbl workspace 3
158 bindsym $mod+apostrophe workspace 4
159 bindsym $mod+parenleft workspace 5
160 bindsym $mod+minus workspace 6
161 bindsym $mod+egrave workspace 7
162 bindsym $mod+underscore workspace 8
163 bindsym $mod+ccedilla workspace 9
164 bindsym $mod+agrave workspace 10
165 #bindsym $mod+1 workspace 1
166 #bindsym $mod+2 workspace 2
167 #bindsym $mod+3 workspace 3
168 #bindsym $mod+4 workspace 4
169 #bindsym $mod+5 workspace 5
170 #bindsym $mod+6 workspace 6
171 #bindsym $mod+7 workspace 7
172 #bindsym $mod+8 workspace 8
173 #bindsym $mod+9 workspace 9
174 #bindsym $mod+0 workspace 10
175
176 # switch to workspace (f1-f4)
177 bindsym F1 workspace 1
178 bindsym F2 workspace 2
179 bindsym F3 workspace 3
180 bindsym F4 workspace 4
181 bindsym Mod1+F1 workspace 5
182 bindsym Mod1+F2 workspace 6
183 bindsym Mod1+F3 workspace 7
184 bindsym Mod1+F4 workspace 8</tt></pre>
185
186 <p>Okay, the first block is default binding. But for many years I decided to leverage F1-F4 keys for workspace movement. Until now, I was using only four workspaces (OpenBox, KDE/GNOME, Fluxbox and XFce), but with i3 and its good support of multiple screens I can afford eight now. Each screen has four independent workspaces.</p>
187
188 <p>Please note the commented part is for Czech layout, therefore if you use this layout uncomment it and delete the above.</p>
189
190 <p>Now let me explain <em>function keys</em> a bit. First of all I realized many years ago that no one (including me) ever use F1 key. It&#8217;s reserved, it&#8217;s for help. But everybody is googling these days instead searching through built-in docs. The same for F2, F3 and F4. Maybe some IDEs offer some important stuff, but I use Vim that has no function keys binding. That is the reason why I gave up with those keys and use them for workspace switching.</p>
191
192 <p>With i3 I have decided also to map Alt+F1-F4 for accessing numbers five to eight. It just seem natural for me now. I am giving up with Alt-F2 (Run App in GNOME) or Alt-F4 (Close App), but this does no work in i3 anymore. Few apps still react on Alt-F4, but there is a different combination available for that.</p>
193
194 <p>If you occasionally need those keys, you can create a re-mapping that would trigger them with Win+F1-F4 keys. But in terminals you can always use ESC combination (ESC;1 for F1). I don&#8217;t use any X11 application that needs that.</p>
195
196 <p>Therefore workspaces 1-4 are on the laptop screen (LDVS1) and 5-8 are on the main monitor (HDMI1). And there is one workspace hidden called scratch one. More about it later.</p>
197
198 <pre><tt># move focused container to workspace
199 bindsym $mod+Shift+1 move container to workspace 1
200 bindsym $mod+Shift+2 move container to workspace 2
201 bindsym $mod+Shift+3 move container to workspace 3
202 bindsym $mod+Shift+4 move container to workspace 4
203 bindsym $mod+Shift+5 move container to workspace 5
204 bindsym $mod+Shift+6 move container to workspace 6
205 bindsym $mod+Shift+7 move container to workspace 7
206 bindsym $mod+Shift+8 move container to workspace 8
207 bindsym $mod+Shift+9 move container to workspace 9
208 bindsym $mod+Shift+0 move container to workspace 10</tt></pre>
209
210 <p>Default setting for transferring windows (containers) among workspaces. Those works for both Czech and English layout and are installed by default.</p>
211
212 <pre><tt># border changing
213 bindsym $mod+b border toggle</tt></pre>
214
215 <p>I cycle through normal, 1pixel and none values with this keybinding. By default it&#8217;s bound to mod+t, mod+y and mod+u.</p>
216
217 <pre><tt># scratchpad
218 bindsym $mod+m move scratchpad
219 bindsym $mod+o scratchpad show</tt></pre>
220
221 <p>Now THIS is cool. There is one hidden workspace that is nowhere and everywhere. It&#8217;s empty by default, thus invisible. You can move there any window you want with mod+m. Container is switched over to floating mode and it&#8217;s centered on the screen giving it some decent size. Than you can quickly show this window with mod+o key. If you hit it twice, it disappears.</p>
222
223 <p>This is cool feature, I like to have an extra terminal there for quick looks while I am working. Maybe you want your favourite e-mail application there. Or something other you want to keep hidden<code>n</code>handy.</p>
224
225 <p>Please note floating applications always stays on top of tiled containers. So scratchpad is not intended for long tasks. It&#8217;s better for short tasks you need to do many times a day. Oh, you can open scratchpad on top of any workspace you want. This is also great for copy and paste.</p>
226
227 <pre><tt># resize window (you can also use the mouse for that)
228 mode &quot;resize&quot; {
229   # These bindings trigger as soon as you enter the resize mode
230   bindsym j resize shrink width 10 px or 10 ppt
231   bindsym k resize grow height 10 px or 10 ppt
232   bindsym l resize shrink height 10 px or 10 ppt
233   bindsym semicolon resize grow width 10 px or 10 ppt
234   #bindsym uring resize grow width 10 px or 10 ppt
235
236   # same bindings, but for the arrow keys
237   bindsym 113 resize shrink width 10 px or 10 ppt
238   bindsym 116 resize grow height 10 px or 10 ppt
239   bindsym 111 resize shrink height 10 px or 10 ppt
240   bindsym 114 resize grow width 10 px or 10 ppt
241
242   # back to normal: Enter or Escape
243   bindsym Return mode &quot;default&quot;
244   bindsym Escape mode &quot;default&quot;
245 }
246
247 bindsym $mod+r mode &quot;resize&quot;</tt></pre>
248
249 <p>I like to resize windows with mouse, but with keys it&#8217;s more fun and also much faster. I need to get used to it. You enter resize mode with mod+r combination, then usint JKL and semicolon (note uring for my Czech layout) you change the window size. And than you <em>must</em> switch back to the normal mode with ESC or ENTER key. Standard key bindings are not available in the resize mode and you will notice why nothing is working. Remember, you <em>need to return</em>.</p>
250
251 <p>I bet you can create your own modes like &#8220;work&#8221; and &#8220;fun&#8221; with totally different key bindings. Never tried this.</p>
252
253 <pre><tt># pulse audio volume control
254 bindsym XF86AudioLowerVolume exec /usr/bin/pactl set-sink-volume 0 -- &#39;-5%&#39;
255 bindsym XF86AudioRaiseVolume exec /usr/bin/pactl set-sink-volume 0 -- &#39;+5%&#39;
256 bindsym XF86AudioMute exec /usr/bin/pactl set-sink-volume 0 0
257 bindsym XF86Launch1 exec /usr/bin/pactl play-sample that_was_easy
258 bindsym XF86MonBrightnessUp exec /usr/bin/xbacklight -inc 10
259 bindsym XF86MonBrightnessDown exec /usr/bin/xbacklight -dec 5</tt></pre>
260
261 <p>Few ThinkPad laptop key bindings for controlling volume, brightness and ThinkVantage for playing That Was Easy (TM) sample just for fun. I don&#8217;t use laptop keyboard much.</p>
262
263 <pre><tt># $mod+n reserved for close all notifications
264 # see ~/.config/dunst/dunstrc for more</tt></pre>
265
266 <p>Just a note for myself not to override mod+n which is used by dunst. More about it later.</p>
267
268 <pre><tt># one bar on both screens
269 bar {
270   position top
271   mode hide
272   modifier $mod
273   status_command i3status
274   tray_output LVDS1
275 }</tt></pre>
276
277 <p>i3 uses i3bar application to draw a very minimalistic bar that can be positioned on the top or bottom of the screen (all screens by default). I like having my bar on top. Content of the bar is delivered with an external program using IPC - i3status in my case. More about its configuration later.</p>
278
279 <p>Only one bar can contain tray area - laptop screen in my case. The bar is very thin, tray icons are also small. I like it. The &#8220;mode hide&#8221; statement hides the bar and opens it once I hit &#8220;modifier&#8221; key, or on a workspace highlight. By the way when the bar is hidden, i3 also notifies the i3status program so it&#8217;s not feeding with data to save CPU time and thus battery.</p>
280
281 <p>By default i3bar shows workspaces and you can switch them with a mouse. It&#8217;s good not to disable this (even if you don&#8217;t use mouse for that) just to have a nice overview about all workspaces which are kind a dynamic (like in GNOME 3), they appear once you move there for the first time and disappear when you leave it (and there is no other container on it). Therefore you can work with them like in GNOME 3 if you want. I have my numbers 9 and 10 ready for that.</p>
282
283 <pre><tt># workspace screens
284 workspace 1 output HDMI1
285 workspace 2 output HDMI1
286 workspace 3 output HDMI1
287 workspace 4 output HDMI1
288 workspace 5 output LVDS1
289 workspace 6 output LVDS1
290 workspace 7 output LVDS1
291 workspace 8 output LVDS1</tt></pre>
292
293 <p>i3 works <strong>very well</strong> with multiple monitors. The default behavior is where you create a workspace it stays there forever, or until you disconnect the screen respectively. Therefore it&#8217;s up to you where you create your workspaces.</p>
294
295 <p>I like to have an order in this, workspaces 1-4 are on the main screen, 5-8 are on the laptop. Therefore I explicitly say this in my configuration. By the way you can easily move workspaces across screens, but I don&#8217;t use any key bindings for that.</p>
296
297 <p>When you disconnect your laptop from dock, everything stays &#8220;as is&#8221; until xrandr notice the screen is off. This is not by default and I like this behavior (depends on your distribution). You can switch off the screen using xranrd command, but sometimes I prefer to attend a meeting or something and then returning without <em>any</em> change (having workspaces on the main screen invisible for a while). I like to have an option in this case. Of course once i3 determines screen has been turned off using xrandr, it moves all workspaces to the remaining screen.</p>
298
299 <p>You can also do this manually with <em>i3-msg workspace N output OUTPUT</em> therefore I created two bash scripts dock and undock that transfers all my workspaces in/out of LDVDS1. This is awesome, I really love this feature. I have never seen a window manager that plays THAT nicely with multiple screens.</p>
300
301 <pre><tt># workspace assignment (use &quot;xprop&quot;)
302 assign [class=&quot;^Google-chrome$&quot;] 3
303 assign [class=&quot;^URxvt$&quot; instance=&quot;^mail$&quot;] 4
304 assign [class=&quot;^Xchat$&quot;] 5
305 assign [class=&quot;^Rednotebook$&quot;] 6
306 assign [class=&quot;^Decibel-audio-player.py$&quot;] 7
307 assign [title=&quot;Lingea Lexicon 5$&quot;] 8
308
309 # custom window settings
310 for_window [class=&quot;^URxvt$&quot; instance=&quot;scratchpad&quot;] border 1pixel; move scratchpad
311 for_window [class=&quot;^Google-chrome$&quot;] border none
312 for_window [title=&quot;Lingea Lexicon 5$&quot;] border none
313
314 # get elluminate working
315 for_window [title=&quot;^Elluminate Live!&quot;] floating enable
316 for_window [title=&quot;^Application Sharing&quot;] floating enable
317 for_window [class=&quot;^net-sourceforge-jnlp-runtime-Boot$&quot; title=&quot;^Downloading&quot;] floating enable</tt></pre>
318
319 <p>In this block, I force some applications to start on specific screens. You can see apps that I use everyday. IRC chat, notebook, audio player, dictionary, browser and that&#8217;s it.</p>
320
321 <p>Than if I start a terminal with the name of &#8220;scratchpad&#8221; it changes its border to 1pixel and moves to the background &#8211; scratchpad, remember? This is cool.</p>
322
323 <p>And I need to use Elluminate application for desktop sharing and meetings. It&#8217;s a Java application that does not look nice in the tiled mode, therefore I force it into floating mode. Good news is it is working actually, if you use it with Sun JRE. There are not many window managers Elluminate is working in, seriously.</p>
324
325 <pre><tt># before autostart
326 exec --no-startup-id pactl upload-sample ~/.i3/that_was_easy.wav that_was_easy
327 exec urxvt -name scratchpad -e bash
328 exec ~/.i3/autostart
329
330 # autostart
331 exec google-chrome
332 exec urxvt -name mail -e bash -c &quot;mutt&quot;
333 exec xchat
334 exec rednotebook
335 exec decibel-audio-player
336 exec lexicon</tt></pre>
337
338 <p>The last block is just auto starting some applications during startup. I load the funny sample, open a scratchpad terminal (which goes to the background automatically) and then I start a shell script with additional commands. I could put this into .xinitrc, but I keep it here. And then some applications.</p>
339
340 <p>When I start my laptop, I get the same. Everyday. Cool, isn&#8217;t it?</p>
341
342 <h2 id='autostart'>Autostart</h2>
343
344 <p>My autostart script triggers some settings and spawns some daemons. It&#8217;s totally optional in i3, you could do everything using &#8220;exec&#8221; commands, but I leveraged my old xinitrc script for that. Let&#8217;s do the showcase again.</p>
345
346 <pre><tt>#!/bin/sh
347
348 ## Desktop background color
349 xsetroot -solid &#39;#101010&#39; &amp;</tt></pre>
350
351 <p>Again, i3 is a window manager, not a desktop environment. I don&#8217;t like &#8220;wallpapers, I just set a decent color here.</p>
352
353 <pre><tt>## Set startup volume
354 pactl set-sink-volume 0 &#39;20%&#39; &amp;</tt></pre>
355
356 <p>I hate random volume after start. Can cause injuries with my speakers. Every time I start my laptop, volume is set to 20 per cent.</p>
357
358 <pre><tt>## Disable beeps
359 xset -b &amp;</tt></pre>
360
361 <p>Don&#8217;t like PC-speaker beeping at all.</p>
362
363 <pre><tt>## Keybord layout setting
364 setxkbmap -layout cz,us -option grp:shift_shift_toggle &amp;</tt></pre>
365
366 <p>I told you &#8211; Czech layout.</p>
367
368 <pre><tt>## DPMS monitor setting (standby -&gt; suspend -&gt; off) (seconds)
369 xset dpms 300 600 900 &amp;</tt></pre>
370
371 <p>I do not use screen &#8220;savers&#8221;, blank it after 5 minutes, suspend and then go off after 5+5 minutes. THIS is screen saving.</p>
372
373 <pre><tt>## Set LCD brightness
374 xbacklight -set 90 &amp;</tt></pre>
375
376 <p>The same story as with volume, backlight set to 90 % after start.</p>
377
378 <pre><tt>## Clipboard manager
379 LC_ALL=C parcellite &amp;</tt></pre>
380
381 <p>Parcellite clipboard manager is widely used, and I love it for my patches that strips whitespace. Go ahead, try it and enable this feature in the preferences. Czech translation is totally wrong, therefore I start it in English.</p>
382
383 <pre><tt>## OSD
384 dunst &amp;</tt></pre>
385
386 <p>And notification daemon. More about it later.</p>
387
388 <h2 id='bar'>Bar</h2>
389
390 <p>As I described earlier, i3bar program uses i3status &#8211; lightweight status generator designed to be very efficient by issuing a very small number of system calls. No scripting support, no external commands. Communication with i3bar is very simple using pipes, if you really need an external command, you can create a wrapper that adds some more info to the i3status output.</p>
391
392 <p>Configuration is pretty straightforward, I will not comment that. I refresh the status line every four seconds, but my bar is hidden most of time, therefore refreshing is suspended which saves you even more cpu ticks!</p>
393
394 <pre><tt>general {
395   colors = true
396   interval = 4
397 }
398
399 order += &quot;disk /home&quot;
400 order += &quot;disk /&quot;
401 order += &quot;run_watch VPN&quot;
402 order += &quot;wireless wlan0&quot;
403 order += &quot;ethernet em1&quot;
404 order += &quot;battery 0&quot;
405 order += &quot;volume master&quot;
406 order += &quot;load&quot;
407 order += &quot;time&quot;
408
409 wireless wlan0 {
410   format_up = &quot;W: (%quality at %essid) %ip&quot;
411   format_down = &quot;W: down&quot;
412 }
413
414 ethernet em1 {
415   # sudo setcap cap_net_admin=ep $(which i3status)
416   format_up = &quot;E: %ip (%speed)&quot;
417   format_down = &quot;E: down&quot;
418 }
419
420 battery 0 {
421   format = &quot;%status %percentage %remaining&quot;
422 }
423
424 run_watch VPN {
425   pidfile = &quot;/var/run/openvpn.pid&quot;
426 }
427
428 time {
429   format = &quot;%d.%m.%Y %H:%M&quot;
430 }
431
432 load {
433   format = &quot;%1min&quot;
434 }
435
436 disk &quot;/&quot; {
437   format = &quot;%free&quot;
438 }
439
440 disk &quot;/home&quot; {
441   format = &quot;%free&quot;
442 }
443
444 volume master {
445   format = &quot;♪: %volume&quot;
446   device = &quot;default&quot;
447   mixer = &quot;Master&quot;
448   mixer_idx = 0
449 }</tt></pre>
450
451 <p>To test it, you can just run <em>i3status</em>. It will fall back to simple text output (real communication with i3bar is with colors):</p>
452
453 <pre><tt>$ i3status 
454 132,1 GB | 56,2 GB | VPN: yes | W: down | E: 192.168.1.1 (1000 Mbit/s) | FULL 55,92% | ♪: 63% | 1,56 | 28.08.2012 19:46</tt></pre>
455
456 <p>As you may noticed, my ThinkPad battery is dying.</p>
457
458 <h2 id='osd'>OSD</h2>
459
460 <p>I use dunst as a notification daemon. It&#8217;s very simple and it looks like a dmenu. The configuration is stored in <em>~/.config/dunst/dunstrc</em> and the default one works great. And it also plays well with multi-monitor setups - you can choose screen to show notifications on and it can also follow your mouse or keyboard (pops up on the screen you actually work on).</p>
461
462 <p>Dunst can group same messages, stack them, sort them by urgency, wrap words and keep messages when computer is in idle (so you would miss them). One can configure colors, format and other basic things for the pop up windows.</p>
463
464 <p>I took the default configuration from <em>/usr/share/dunst/dunstrc</em> and kept the sane defaults. The most important setting change for me was:</p>
465
466 <pre><tt>close_all = mod4+n</tt></pre>
467
468 <p>I use Win+n to close all notifications. Nice.</p>
469
470 <h2 id='wrapup'>Wrap-up</h2>
471
472 <p>Okay, I think I showed you <a href='http://i3wm.org'>i3</a>. Highly recommended tiling window manager. Share your opinions on this page with me!</p>
473
474 <p><strong>Update</strong>: I have pushed all my configuration files to <a href='https://github.com/lzap/doti3'>git repository</a>.</p>