]> git.sur5r.net Git - i3/i3.github.io/blob - docs/user-contributed/lzap-config.html.mako
remove obsolete blog controller
[i3/i3.github.io] / docs / user-contributed / lzap-config.html.mako
1 <%!
2         section = "docs"
3 %>
4 <%inherit file="_templates/i3.mako" />
5 <div id="content" class="usergen">
6 <h1>User-contributed article: Lukáš Zapletal’s i3 configuration</h1>
7
8 <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>
9
10 <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>
11
12 <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>
13
14 <h2 id='installation'>Installation</h2>
15
16 <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>
17
18 <pre><tt># yum -y install i3 i3lock dmenu dunst</tt></pre>
19
20 <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>
21
22 <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>
23
24 <h2 id='i3_configuration'>i3 configuration</h2>
25
26 <p>Configuration is located in <strong>.i3/config</strong>. Let&#8217;s do the walkthrough.</p>
27
28 <pre><tt>set $mod Mod4</tt></pre>
29
30 <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>
31
32 <pre><tt># font for window titles. ISO 10646 = Unicode
33 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1</tt></pre>
34
35 <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>
36
37 <pre><tt># Use Mouse+$mod to drag floating windows to their wanted position
38 floating_modifier $mod</tt></pre>
39
40 <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>
41
42 <pre><tt># start a terminal
43 bindsym $mod+Return exec i3-sensible-terminal</tt></pre>
44
45 <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>
46
47 <pre><tt># kill focused window
48 bindsym $mod+Shift+Q kill</tt></pre>
49
50 <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>
51
52 <pre><tt># start dmenu (a program launcher)
53 bindsym $mod+d exec dmenu_run</tt></pre>
54
55 <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>
56
57 <pre><tt># reload/restart/exit
58 bindsym $mod+Shift+C reload
59 bindsym $mod+Shift+R restart
60 bindsym $mod+Shift+E exit</tt></pre>
61
62 <p>Few default key bindings you will like when playing with configuration.</p>
63
64 <pre><tt># screen locker (first move to &quot;safe&quot; workspace without any chat app)
65 bindsym Control+Mod1+l exec i3-msg workspace 1 &amp;&amp; i3lock -c 111111 -d</tt></pre>
66
67 <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>
68
69 <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>
70
71 <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>
72
73 <pre><tt># change focus
74 bindsym $mod+j focus left
75 bindsym $mod+k focus down
76 bindsym $mod+l focus up
77 bindsym $mod+semicolon focus right
78 #bindsym $mod+uring focus right</tt></pre>
79
80 <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>
81
82 <pre><tt># alternatively, you can use the cursor keys:
83 bindsym $mod+Left focus left
84 bindsym $mod+Down focus down
85 bindsym $mod+Up focus up
86 bindsym $mod+Right focus right</tt></pre>
87
88 <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>
89
90 <pre><tt># move focused window
91 bindsym $mod+Shift+J move left
92 bindsym $mod+Shift+K move down
93 bindsym $mod+Shift+L move up
94 bindsym $mod+Shift+colon move right</tt></pre>
95
96 <p>Moving windows around is so simple with tiling managers. Just hold shift and you drag the window there.</p>
97
98 <pre><tt># alternatively, you can use the cursor keys:
99 bindsym $mod+Shift+Left move left
100 bindsym $mod+Shift+Down move down
101 bindsym $mod+Shift+Up move up
102 bindsym $mod+Shift+Right move right</tt></pre>
103
104 <p>I don&#8217;t use this with arrow keys, but it&#8217;s defined by default. Why not.</p>
105
106 <pre><tt># split in horizontal orientation
107 bindsym $mod+h split h
108
109 # split in vertical orientation
110 bindsym $mod+v split v</tt></pre>
111
112 <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>
113
114 <pre><tt># enter fullscreen mode for the focused container
115 bindsym $mod+f fullscreen</tt></pre>
116
117 <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>
118
119 <pre><tt># change container layout (stacked, tabbed, default)
120 bindsym $mod+s layout stacking
121 bindsym $mod+w layout tabbed
122 bindsym $mod+e layout default</tt></pre>
123
124 <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>
125
126 <pre><tt># toggle tiling / floating
127 bindsym $mod+Shift+space floating toggle</tt></pre>
128
129 <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>
130
131 <pre><tt># change focus between tiling / floating windows
132 bindsym $mod+space focus mode_toggle</tt></pre>
133
134 <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>
135
136 <pre><tt># focus the parent container
137 #bindsym $mod+a focus parent
138
139 # focus the child container
140 #bindcode $mod+d focus child</tt></pre>
141
142 <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>
143
144 <pre><tt># next/previous workspace
145 bindsym Mod1+Tab focus right
146 bindsym Mod1+Shift+Tab focus left
147 bindsym $mod+Tab workspace back_and_forth</tt></pre>
148
149 <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>
150
151 <p>Shift does the other way around while Win+Tab switches to the last used weapon. Sorry, I said weapon? I mean workspace.</p>
152
153 <pre><tt># switch to workspace
154 bindsym $mod+ampersand workspace 1
155 bindsym $mod+eacute workspace 2
156 bindsym $mod+quotedbl workspace 3
157 bindsym $mod+apostrophe workspace 4
158 bindsym $mod+parenleft workspace 5
159 bindsym $mod+minus workspace 6
160 bindsym $mod+egrave workspace 7
161 bindsym $mod+underscore workspace 8
162 bindsym $mod+ccedilla workspace 9
163 bindsym $mod+agrave workspace 10
164 #bindsym $mod+1 workspace 1
165 #bindsym $mod+2 workspace 2
166 #bindsym $mod+3 workspace 3
167 #bindsym $mod+4 workspace 4
168 #bindsym $mod+5 workspace 5
169 #bindsym $mod+6 workspace 6
170 #bindsym $mod+7 workspace 7
171 #bindsym $mod+8 workspace 8
172 #bindsym $mod+9 workspace 9
173 #bindsym $mod+0 workspace 10
174
175 # switch to workspace (f1-f4)
176 bindsym F1 workspace 1
177 bindsym F2 workspace 2
178 bindsym F3 workspace 3
179 bindsym F4 workspace 4
180 bindsym Mod1+F1 workspace 5
181 bindsym Mod1+F2 workspace 6
182 bindsym Mod1+F3 workspace 7
183 bindsym Mod1+F4 workspace 8</tt></pre>
184
185 <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>
186
187 <p>Please note the commented part is for Czech layout, therefore if you use this layout uncomment it and delete the above.</p>
188
189 <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>
190
191 <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>
192
193 <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>
194
195 <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>
196
197 <pre><tt># move focused container to workspace
198 bindsym $mod+Shift+1 move container to workspace 1
199 bindsym $mod+Shift+2 move container to workspace 2
200 bindsym $mod+Shift+3 move container to workspace 3
201 bindsym $mod+Shift+4 move container to workspace 4
202 bindsym $mod+Shift+5 move container to workspace 5
203 bindsym $mod+Shift+6 move container to workspace 6
204 bindsym $mod+Shift+7 move container to workspace 7
205 bindsym $mod+Shift+8 move container to workspace 8
206 bindsym $mod+Shift+9 move container to workspace 9
207 bindsym $mod+Shift+0 move container to workspace 10</tt></pre>
208
209 <p>Default setting for transferring windows (containers) among workspaces. Those works for both Czech and English layout and are installed by default.</p>
210
211 <pre><tt># border changing
212 bindsym $mod+b border toggle</tt></pre>
213
214 <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>
215
216 <pre><tt># scratchpad
217 bindsym $mod+m move scratchpad
218 bindsym $mod+o scratchpad show</tt></pre>
219
220 <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>
221
222 <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>
223
224 <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>
225
226 <pre><tt># resize window (you can also use the mouse for that)
227 mode &quot;resize&quot; {
228   # These bindings trigger as soon as you enter the resize mode
229   bindsym j resize shrink width 10 px or 10 ppt
230   bindsym k resize grow height 10 px or 10 ppt
231   bindsym l resize shrink height 10 px or 10 ppt
232   bindsym semicolon resize grow width 10 px or 10 ppt
233   #bindsym uring resize grow width 10 px or 10 ppt
234
235   # same bindings, but for the arrow keys
236   bindsym 113 resize shrink width 10 px or 10 ppt
237   bindsym 116 resize grow height 10 px or 10 ppt
238   bindsym 111 resize shrink height 10 px or 10 ppt
239   bindsym 114 resize grow width 10 px or 10 ppt
240
241   # back to normal: Enter or Escape
242   bindsym Return mode &quot;default&quot;
243   bindsym Escape mode &quot;default&quot;
244 }
245
246 bindsym $mod+r mode &quot;resize&quot;</tt></pre>
247
248 <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>
249
250 <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>
251
252 <pre><tt># pulse audio volume control
253 bindsym XF86AudioLowerVolume exec /usr/bin/pactl set-sink-volume 0 -- &#39;-5%&#39;
254 bindsym XF86AudioRaiseVolume exec /usr/bin/pactl set-sink-volume 0 -- &#39;+5%&#39;
255 bindsym XF86AudioMute exec /usr/bin/pactl set-sink-volume 0 0
256 bindsym XF86Launch1 exec /usr/bin/pactl play-sample that_was_easy
257 bindsym XF86MonBrightnessUp exec /usr/bin/xbacklight -inc 10
258 bindsym XF86MonBrightnessDown exec /usr/bin/xbacklight -dec 5</tt></pre>
259
260 <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>
261
262 <pre><tt># $mod+n reserved for close all notifications
263 # see ~/.config/dunst/dunstrc for more</tt></pre>
264
265 <p>Just a note for myself not to override mod+n which is used by dunst. More about it later.</p>
266
267 <pre><tt># one bar on both screens
268 bar {
269   position top
270   mode hide
271   modifier $mod
272   status_command i3status
273   tray_output LVDS1
274 }</tt></pre>
275
276 <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>
277
278 <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>
279
280 <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>
281
282 <pre><tt># workspace screens
283 workspace 1 output HDMI1
284 workspace 2 output HDMI1
285 workspace 3 output HDMI1
286 workspace 4 output HDMI1
287 workspace 5 output LVDS1
288 workspace 6 output LVDS1
289 workspace 7 output LVDS1
290 workspace 8 output LVDS1</tt></pre>
291
292 <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>
293
294 <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>
295
296 <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>
297
298 <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>
299
300 <pre><tt># workspace assignment (use &quot;xprop&quot;)
301 assign [class=&quot;^Google-chrome$&quot;] 3
302 assign [class=&quot;^URxvt$&quot; instance=&quot;^mail$&quot;] 4
303 assign [class=&quot;^Xchat$&quot;] 5
304 assign [class=&quot;^Rednotebook$&quot;] 6
305 assign [class=&quot;^Decibel-audio-player.py$&quot;] 7
306 assign [title=&quot;Lingea Lexicon 5$&quot;] 8
307
308 # custom window settings
309 for_window [class=&quot;^URxvt$&quot; instance=&quot;scratchpad&quot;] border 1pixel; move scratchpad
310 for_window [class=&quot;^Google-chrome$&quot;] border none
311 for_window [title=&quot;Lingea Lexicon 5$&quot;] border none
312
313 # get elluminate working
314 for_window [title=&quot;^Elluminate Live!&quot;] floating enable
315 for_window [title=&quot;^Application Sharing&quot;] floating enable
316 for_window [class=&quot;^net-sourceforge-jnlp-runtime-Boot$&quot; title=&quot;^Downloading&quot;] floating enable</tt></pre>
317
318 <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>
319
320 <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>
321
322 <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>
323
324 <pre><tt># before autostart
325 exec --no-startup-id pactl upload-sample ~/.i3/that_was_easy.wav that_was_easy
326 exec urxvt -name scratchpad -e bash
327 exec ~/.i3/autostart
328
329 # autostart
330 exec google-chrome
331 exec urxvt -name mail -e bash -c &quot;mutt&quot;
332 exec xchat
333 exec rednotebook
334 exec decibel-audio-player
335 exec lexicon</tt></pre>
336
337 <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>
338
339 <p>When I start my laptop, I get the same. Everyday. Cool, isn&#8217;t it?</p>
340
341 <h2 id='autostart'>Autostart</h2>
342
343 <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>
344
345 <pre><tt>#!/bin/sh
346
347 ## Desktop background color
348 xsetroot -solid &#39;#101010&#39; &amp;</tt></pre>
349
350 <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>
351
352 <pre><tt>## Set startup volume
353 pactl set-sink-volume 0 &#39;20%&#39; &amp;</tt></pre>
354
355 <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>
356
357 <pre><tt>## Disable beeps
358 xset -b &amp;</tt></pre>
359
360 <p>Don&#8217;t like PC-speaker beeping at all.</p>
361
362 <pre><tt>## Keybord layout setting
363 setxkbmap -layout cz,us -option grp:shift_shift_toggle &amp;</tt></pre>
364
365 <p>I told you &#8211; Czech layout.</p>
366
367 <pre><tt>## DPMS monitor setting (standby -&gt; suspend -&gt; off) (seconds)
368 xset dpms 300 600 900 &amp;</tt></pre>
369
370 <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>
371
372 <pre><tt>## Set LCD brightness
373 xbacklight -set 90 &amp;</tt></pre>
374
375 <p>The same story as with volume, backlight set to 90 % after start.</p>
376
377 <pre><tt>## Clipboard manager
378 LC_ALL=C parcellite &amp;</tt></pre>
379
380 <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>
381
382 <pre><tt>## OSD
383 dunst &amp;</tt></pre>
384
385 <p>And notification daemon. More about it later.</p>
386
387 <h2 id='bar'>Bar</h2>
388
389 <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>
390
391 <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>
392
393 <pre><tt>general {
394   colors = true
395   interval = 4
396 }
397
398 order += &quot;disk /home&quot;
399 order += &quot;disk /&quot;
400 order += &quot;run_watch VPN&quot;
401 order += &quot;wireless wlan0&quot;
402 order += &quot;ethernet em1&quot;
403 order += &quot;battery 0&quot;
404 order += &quot;volume master&quot;
405 order += &quot;load&quot;
406 order += &quot;time&quot;
407
408 wireless wlan0 {
409   format_up = &quot;W: (%quality at %essid) %ip&quot;
410   format_down = &quot;W: down&quot;
411 }
412
413 ethernet em1 {
414   # sudo setcap cap_net_admin=ep $(which i3status)
415   format_up = &quot;E: %ip (%speed)&quot;
416   format_down = &quot;E: down&quot;
417 }
418
419 battery 0 {
420   format = &quot;%status %percentage %remaining&quot;
421 }
422
423 run_watch VPN {
424   pidfile = &quot;/var/run/openvpn.pid&quot;
425 }
426
427 time {
428   format = &quot;%d.%m.%Y %H:%M&quot;
429 }
430
431 load {
432   format = &quot;%1min&quot;
433 }
434
435 disk &quot;/&quot; {
436   format = &quot;%free&quot;
437 }
438
439 disk &quot;/home&quot; {
440   format = &quot;%free&quot;
441 }
442
443 volume master {
444   format = &quot;♪: %volume&quot;
445   device = &quot;default&quot;
446   mixer = &quot;Master&quot;
447   mixer_idx = 0
448 }</tt></pre>
449
450 <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>
451
452 <pre><tt>$ i3status 
453 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>
454
455 <p>As you may noticed, my ThinkPad battery is dying.</p>
456
457 <h2 id='osd'>OSD</h2>
458
459 <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>
460
461 <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>
462
463 <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>
464
465 <pre><tt>close_all = mod4+n</tt></pre>
466
467 <p>I use Win+n to close all notifications. Nice.</p>
468
469 <h2 id='wrapup'>Wrap-up</h2>
470
471 <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>
472
473 <p><strong>Update</strong>: I have pushed all my configuration files to <a href='https://github.com/lzap/doti3'>git repository</a>.</p>