[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:i3wm [2012/09/01 19:59 (UTC)] – [i3status] Link to TaskWarrior sycamorexhowtos:i3wm [2012/09/25 04:23 (UTC)] (current) – deleted page - moved to the howtos:window_managers section mfillpot
Line 1: Line 1:
-<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> 
-===== i3 tiling window manager ===== 
  
-i3 is a very lightweight, flexible and customisable tiling [[slackware:window_manager|window manager]] with excellent multi-monitor support. Tiling window managers aim at maximising the screen space by tiling all opened windows in a non-overlapping mode. As all the bells and whistles of traditional desktops are virtually non-existent in tiling window managers, they have a very minimalist look and are mostly keyboard-focused. If the concept of tiling window managers is still puzzling, please check the i3 official [[http://www.i3wm.org/screenshots/|screencast]]. 
- 
-==== i3 in Slackware==== 
- 
-Slackware does not come with the i3 window manager. The installation process, however, is a quick an easy one. i3 is available from [[http://slackbuilds.org/repository/13.37/desktop/i3/|SlackBuilds]].You can build and install the dependencies using [[http://docs.slackware.com/howtos:lets_build_a_slackbuild|this]] tutorial or via [[http://www.sbopkg.org/|sbopkg]], a SlackBuild browser. 
- 
-==== i3 dependencies ==== 
- 
-All i3's dependencies are also available from [[http://slackbuilds.org|SlackBuilds]]: 
- 
-  * [[http://slackbuilds.org/repository/13.37/libraries/libev/|libev]] 
-  * [[http://slackbuilds.org/repository/13.37/libraries/yajl/|yajl]] 
-  * [[http://slackbuilds.org/repository/13.37/desktop/dmenu/|dmenu]] 
- 
-It is also highly recommended to install [[http://slackbuilds.org/repository/13.37/desktop/i3status/|i3status]] and its dependency [[http://slackbuilds.org/repository/13.37/libraries/confuse/|confuse]]. 
- 
-==== Starting i3 ==== 
- 
-Having installed all the packages, you can exit X and run ''xwmconfig'' to select i3 and subsequently run ''startx'' to start the graphical user interface. 
- 
-=== Known issues === 
- 
-== i3 and nVidia binary driver == 
- 
-Up until recently, nVidia binary driver users had to add the ''--force-xinerama'' flag to their ''.xinitrc'' file.  
- 
-<code># Start i3 
- 
-if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then 
-    exec ck-launch-session i3 --force-xinerama 
-else 
-    exec i3 
-fi</code> 
- 
-As of version 302.17 of nVidia binary driver it is **no longer necessary**. (See more [[http://www.phoronix.com/scan.php?page=news_item&px=MTA5NTY|info]]) 
- 
-== i3 and Thunar (Slackware 14rcX) == 
- 
-The ''.xinitrc'' file generated by i3.Slackbuild for Slackware 13.37 works fine. There are some issues with Thunar automounting USB drives on Slackware 14, though. The modification in i3 SlackBuild scripts for Slackware 14 have already been submitted. In the meantime if you use Slackware 14rcX, you can add ''dbus-launch --exit-with-session'' to the startup line: 
- 
-<code># Start i3 
-if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then 
-    exec ck-launch-session dbus-launch --exit-with-session /usr/bin/i3 
-else 
-    exec i3 
-fi</code> 
- 
- 
-==== i3 configuration ==== 
- 
-When you first start i3, you will be welcomed by ''i3-config-wizard'': 
- 
-<code>You have not configured i3 yet. 
-Do you want me to generate ~/.i3/config? 
- 
-<Enter> Yes, generate ~/.i3/config 
-<Esc>   No, I will use the defaults</code> 
- 
-Let the wizard generate the config file. You'll then face another dillema: 
- 
-<code>Please choose either: 
- 
---> <Win>  Win as default modifier 
-    <Alt>  Alt as default modifier 
- 
-Afterwards, press 
- 
-<Enter> to write ~/.i3/config 
-<ESC>   to abort</code> 
- 
-Use the ''Win'' and ''Alt'' keys to switch between the modifiers and choose one of them. In this tutorial I use Alt as the default modifier (I use ''Win'' for all sorts of custom keybindigs to avoid and clashes with i3 or other applications). 
- 
-<note>Please note that if you've changed the keyboard layout since the wizard automatically generated the config file, you might have to revisit the config file and manually modify the keybindings</note> 
- 
-=== Changing i3 modifier key(s) === 
- 
-It is easy to change or add i3 modifiers. Right at the top of the ''~/.i3/config'' file you'll see: 
- 
-''Alt'' as the default modifier: 
- 
-<code> set $mod Mod1</code> 
- 
-Or ''Win'' as the default modifier: 
- 
-<code> set $mod Mod4</code> 
- 
-You can also configure a secondary modifier assigning it to a variable (eg. $ms): 
- 
-<code>set $mod Mod1 
-set $ms Mod4</code> 
- 
-=== Keybindings for most common activities and applications === 
- 
-The following are some basic keybindings to help you get started. 
- 
-== Terminal == 
- 
-Pressing Alt+Return launches a terminal which in Slackware defaults to ''xterm''. If you want to change it, modify the following line: 
- 
-<code>bindsym $mod+Return exec i3-sensible-terminal</code> 
- 
-Specify a terminal of your choice: 
- 
-<code>bindsym $mod+Return exec /usr/bin/urxvt</code> 
- 
-== Close a window == 
- 
-<code>Alt+Shift+Q</code> 
- 
-== Go to a given workspace == 
- 
-<code>Alt+2</code> 
- 
-In this instance we go to Workspace 2. 
- 
-== Reload the config == 
- 
-<code>Alt+Shift+C</code> 
- 
-== Restart i3 == 
- 
-<code>Alt+Shift+R</code> 
- 
-== Quit i3 == 
- 
-<code>Alt+Shift+E</code> 
- 
- 
-=== Adding your own keybindings === 
- 
-If you want to launch Firefox using ''Alt+b'', add the following to ''~/.i3/config'': 
- 
-<code>bindsym $mod+b exec /usr/bin/firefox</code> 
- 
- 
-=== Opening other applications === 
- 
-The ''Alt+d'' keybinding launches dmenu where you can type a program you want to run. 
- 
-=== Keyboard layout === 
- 
-Please visit [[http://docs.slackware.com/howtos:keyboard_layout_in_i3|this HOWTO]] to configure the keyboard layout in i3. 
- 
-=== Further reading === 
- 
-i3 has a great number of features. Discussing all of them is beyond the scope of this HOWTO. For further help, please refer to i3's excellent [[http://www.i3wm.org/docs/userguide.html|User's Guide]]. 
- 
-These are some notable features: 
- 
-  * Excellent window management ([[http://www.i3wm.org/docs/userguide.html#_tree|concept of container trees]]) 
-  * [[http://www.i3wm.org/docs/userguide.html#_automatically_putting_clients_on_specific_workspaces|Automatically putting clients on specific workspaces]] 
-  * [[http://www.i3wm.org/docs/userguide.html#_scratchpad|The scratchpad feature]] 
- 
-==== i3status ==== 
- 
-[[http://slackbuilds.org/repository/13.37/desktop/i3status/|i3status]] is a status bar generator which will help you display all sorts of information. 
- 
-Once you've started i3, you should see a status bar at the bottom of the screen. To start customising it, copy /etc/i3status.conf to ~/.i3status.conf where you can place your changes. The configuration is pretty straightforward. You can comment out any modules you don't want to be displayed: 
- 
-<code># order  = "ipv6" 
-order += "disk /" 
-# order += "run_watch DHCP" 
-# order += "run_watch VPN" 
-order += "wireless wlan4" 
-#order += "ethernet eth0" 
-# order += "battery 0" 
-# order += "cpu_temperature 0" 
-order += "load" 
-order += "time"</code> 
- 
-You can configure modules in the sections below. For example: 
- 
-<code>time { 
-        format = "%d-%m-%Y %H:%M" 
-}</code> 
- 
-=== Custom i3status display === 
- 
-By default ''i3status'' functionality is somewhat limited. The fact that the basic configuration offers only a handful of predefined functions does not, however, prevent you from customising it to include your own scripts. 
- 
-The most basic method of calling i3status is by including the following code in ''~/i3.config'': 
- 
-<code>bar { 
-        status_command i3status 
-}</code> 
- 
-i3status will first look for ''~/.i3status.conf'' and if it is not present, it will read ''/etc/i3status.conf''. You can also manually specify the location of the config file: 
-<code>status_command i3status --config ~/.i3/scripts/i3status.conf</code> 
- 
-Instead of calling ''i3status'' here, you can run a custom script which will start ''i3status''. 
- 
-<code>status_command /path/to/my/i3-custom-status.sh</code> 
- 
-i3-custom-status.sh 
-<code>#!/bin/sh 
-# shell scipt to prepend i3status output with some custom stuff 
- 
-i3status --config ~/.i3status-secondary.conf | while : 
-do 
-        read line 
-        LG=$(setxkbmap -print | grep xkb_symbols | awk -F"+" '{print $2}' 
-        pycom=$(/home/xtd8865/.i3/pys.py) 
-        todo=$(task ls | sed -n '4s/[[:blank:]]\+/ /pg' ) 
-        echo "TODO:$todo | LG: $LG | $pycom | $line" || exit 1 
-done</code> 
-The following should give you some idea of how you could adapt it for your own needs: 
- 
-<code>LG=$(setxkbmap -print | grep xkb_symbols | awk -F"+" '{print $2}')</code> 
- 
-The current keyboard layout is assigned to variable ''LG''. 
- 
-<code>pycom=$(/home/user/.i3/pys.py)</code> 
- 
-The output of a Python script is assigned to variable ''pycon''. 
- 
-<code>todo=$(task ls | sed -n '4s/[[:blank:]]\+/ /pg' )</code> 
- 
-The most important task of my todo list ([[http://taskwarrior.org/projects/show/taskwarrior|TaskWarrior]]) is assigned to variable ''todo''. 
- 
-<code>echo "TODO:$todo | LG: $LG | $pycom | $line" || exit 1</code> 
- 
-The contents of the variables is sent to the status bar followed by default ''i3status'' output.  
- 
- 
-=== i3status in a multi-monitor setup === 
- 
-You can identify your monitors using the 'xrandr' utility: 
- 
-<code>$ xrandr 
-Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384 
-DVI-I-0 disconnected (normal left inverted right x axis y axis) 
-VGA-0 disconnected (normal left inverted right x axis y axis) 
-DVI-I-1 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm 
-   1920x1200      60.0*+ 
-... 
-HDMI-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 519mm x 324mm 
-   1920x1200      60.0*+ 
-...</code> 
- 
-The active connections are identified as ''DVI-I-1'' and ''HDMI-0''. Knowing this we can configure separate outputs for each display: 
- 
-<code>bar { 
-        output DVI-I-1 
-        status_command i3status 
-        font -*-terminus-bold-*-normal-*-20-*-*-*-*-*-iso8859-1 
-        colors { 
-                background: #002b36 
-                statusline: #586e75 
-                focused_workspace: $col3 $col2 $col9 
-                active_workspace: $col3 $col2 $col16 
-                inactive_workspace: $col3 $col2 $col3 
-                urgent_workspace: $col11 $col12 $col13 
-                } 
-} 
- 
-bar { 
-        output HDMI-0 
-        status_command /home/user/.i3/scripts/i3status_script.sh 
-        font -*-terminus-bold-*-normal-*-20-*-*-*-*-*-iso8859-1 
-}</code> 
- 
-==== i3 Support ==== 
- 
-Apart from excellent [[http://www.i3wm.org/docs/|documentation]] both for i3 users and developers, you can also get support: 
-  * Subscribe to the [[i3-discuss-subscribe@i3.zekjur.net|mailing list]] (Browse [[http://infra.in.zekjur.net/archives/i3-discuss/|archives]]) 
-  * Join i3 IRC channel (#i3 on irc.twice-irc.de) 
-  * Register with the recently created stackexchange-like [[http://faq.i3wm.org/questions/|FAQ section]] 
- 
- 
- 
- 
- 
-====== Sources ====== 
-  * Originally written by [[wiki:user:sycamorex |sycamorex]] 
-<!-- * Contrbutions by [[wiki:user:yyy | User Y]] --> 
- 
-<!-- Please do not modify anything below, except adding new tags.--> 
-<!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> 
-{{tag>howtos i3 i3status wm software}} 
 howtos:i3wm ()