i3

From ArchWiki
Revision as of 20:21, 10 November 2011 by Filam (Talk | contribs) (i3-wsbar: Remove dead links)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

i3 is a dynamic tiling window manager inspired by wmii that is primarily targeted at developers and advanced users.

Introduction

The developers' attempt to hack and fix wmii led to the creation of i3. At the time Wmii didn't provide certain features, like support for Xinerama, and lacked source code comments and documentation.

Clients within i3 are either allowed to float or placed into containers. Clients can be stacked or tabbed within containers.

Installation

i3 is located in the Template:Codeline repository. Installing i3 can be accomplished by choosing the Template:Package Official group, which includes the packages Template:Package Official, Template:Package Official and Template:Package Official.

# pacman -S i3

Alternatively, you can install the window manager exclusively:

# pacman -S i3-wm

Additionally, Template:Package AUR is available in AUR.

Running i3

Edit your Template:Filename and add:

exec i3

If you want i3 to log its output (useful for debugging), add this line to Template:Filename:

exec i3 -V >>~/.i3/i3log >&1

If you use the Nvidia binary driver you need to add the --force-xinerama flag to Template:Filename. A detailed explanation can be found at i3wm.org.

exec i3 --force-xinerama

Basic Keybindings and Window Management

The default keybindings mostly depend on Mod1 (usually mapped to Alt) as the basic modifier key sometimes combined with Ctrl or Shift. Other binds use Mod3 as the base modifier (often the Windows-key). To identify the different Mod# keys on your system, use the command Template:Codeline without arguments.

The key combinations are configured in the file Template:Filename (or, if it does not exist, Template:Filename).

The default key combinations rely on key codes and not on the actual letters of your keyboard layout! You can replace the Template:Codeline directives in the config with Template:Codeline directives if you do not like this. For more info on configuration see the next section.

Some of the most important keybindings include the following:

  • Run a program: Mod1+v
  • Create a new terminal: Mod1+Enter
  • Switch between different windows: Mod1+ any of "jkl;" or cursor keys (somewhat Vim-like keybindings)
  • Move a window: Mod1+Shift+ any of "jkl;" or cursor keys
  • Switch to a different workspace: Mod1+ any number
  • Move window to a different workspace: Mod1+Shift+ any number

Note that i3 uses containers for window management. So in contrast to Wmii you can also tile windows horizontally. To do this, simply move a window up or down (with Mod1+Shift+DirectionKey) beyond the edge of the screen. A new row will appear. You can then use Mod4+Ctrl+DirectionKey to enlarge the window into the chosen direction. DirectionKey can be the arrow keys as well as "jkl;".

There are 3 container modes:

  • Normal (columns): Mod1+e
  • Tabbed: Mod1+w
  • Stacked: Mod1+s

Additionally, you can put a window into fullscreen mode with Mod1+f.

i3 keybinding cheatsheet (pdf)

Configuration

i3 is configured using a simple text file. It first looks for Template:Filename and if it doesn't exist, reads the default config at Template:Filename. So to start customizing, copy the config file to your home directory:

cp /etc/i3/config ~/.i3/config

The config allows you to change such things as:

  • Border colors
  • Font
  • Keybindings
  • Workspace names
  • Default container layout
  • Assignment of apps to specific workspaces

The i3 User's Guide gives a nice overview of the config settings.

For users seeking to convert their configuration to v4, i3-wm comes with a perl script for conversion:

mv config config.old #save the old file
i3-migrate-config-to-v4 config.old > config

Have a look at the changes!

Status bar

The internal status bar has been replace by i3bar in version 4 of i3. It can be used to view information generated by conky or i3status. For example:

exec i3bar -c 'conky -c ~/.i3/conki3'
exec i3bar -c 'i3status'

Alternate methods

dzen

Dzen can be placed in the status bar at the bottom of the screen. Information for dzen2 can be generated using Template:Package Official

i3status | dzen2 &

or Template:Package Official

conky | dzen2 &

The svn development version of dzen2 in the AUR offers a -dock option, which puts dzen2 at the bottom of the screen and tells i3 not to manage it.

i3-wsbar

In the AUR you can also find Template:Package AUR, which is able to get the list of workspaces from the socket that i3 offers for IPC. Thus you can pipe the conky output to i3-wsbar and tell it to use dzen2. For example, put the following in your i3 configuration file:

~/.i3/config
exec conky | i3-wsbar -c "dzen2 -x %x -dock -fn -*-profont-*-*-*-*-11-*-*-*-*-*-*-* -ta l"

For further information see External workspace bars.

Note: Dzen color codes can be used in your conky configuration file.

Comparison of i3bar and dzen2

This comparison of i3bar and dzen2 only takes into account how well the two programs can handle the input from conky or i3status.

Program Color Codes Formatting Special Fonts Dock Trayer
i3bar No No, right aligned No (UTF8 only) Yes Yes (git)
dzen2 Yes No, left aligned Yes Yes (the svn version) No

Though development of i3bar is very active and support for custom formatting and fonts has been announced, dzen2-svn has an edge over i3bar (as of August 7th). From the i3bar man page:

i3bar does not yet support formatting in the displayed statusline. However it does support setting colors for the
bar, the workspace-buttons and the statusline.

Other tools

i3 currently uses dmenu as a application launcher, which is bound by default to Template:Keypress+Template:Keypress.

i3lock is a screen locker inspired by Template:Package Official.

Additional sources