Difference between revisions of "I3 Tiling Window Manager"
(Walkthrough that hopefully helps others set up i3.) |
(Added more information about xrandr and began work on i3config) |
||
| Line 1: | Line 1: | ||
<pre> Work in progress. Page will hopefully be completed soon</pre> | <pre> Work in progress. Page will hopefully be completed soon</pre> | ||
| − | |||
== Introduction == | == Introduction == | ||
i3 is a tiling window manager that is based upon experiences the developers shared while attempting to fix/hack wmii. i3 has the ability for either floating windows, which you can resize and move, and tiling windows. i3 uses a tree as a data structure to allow for more flexibility. i3 defaults with home-row key-bindings which are quick and easy to get beginner's off the ground. | i3 is a tiling window manager that is based upon experiences the developers shared while attempting to fix/hack wmii. i3 has the ability for either floating windows, which you can resize and move, and tiling windows. i3 uses a tree as a data structure to allow for more flexibility. i3 defaults with home-row key-bindings which are quick and easy to get beginner's off the ground. | ||
| + | |||
| + | '''NOTE: This wiki is made following the steps produced to get a working i3 using xrandr instead of xinerama, ATI proprietary drivers instead of radeon drivers, a dual-monitor setup, and no login manager. For Nvidia and Twinview users, a link is supplied in [[#X11 and xrandr|X11 and xrandr]]. Xinerama was initially used and worked in the dual-monitor setup so it possible to substitute xinerama for xrandr with minimal changes.''' | ||
=== Documentation === | === Documentation === | ||
| + | |||
==== Websites ==== | ==== Websites ==== | ||
| + | |||
[http://i3wm.org/ i3] | [http://i3wm.org/ i3] | ||
| Line 13: | Line 16: | ||
==== Man pages ==== | ==== Man pages ==== | ||
| + | |||
* i3 | * i3 | ||
* i3-config-wizard | * i3-config-wizard | ||
| Line 28: | Line 32: | ||
== Installation == | == Installation == | ||
| + | |||
=== Portage === | === Portage === | ||
| + | |||
The easiest and quickest way: | The easiest and quickest way: | ||
<pre># emerge -avt x11-wm/i3</pre> | <pre># emerge -avt x11-wm/i3</pre> | ||
| + | |||
=== Manual === | === Manual === | ||
| + | |||
==== Tarball ==== | ==== Tarball ==== | ||
| + | |||
Download the latest version from the i3 website. | Download the latest version from the i3 website. | ||
| + | |||
[http://i3wm.org/downloads/i3-4.1.1.tar.bz2 i3-4.1.1] | [http://i3wm.org/downloads/i3-4.1.1.tar.bz2 i3-4.1.1] | ||
| Line 41: | Line 51: | ||
==== Git ==== | ==== Git ==== | ||
| + | |||
<pre># git clone git://code.i3wm.org/i3 | <pre># git clone git://code.i3wm.org/i3 | ||
# cd i3 | # cd i3 | ||
| Line 47: | Line 58: | ||
== Setup == | == Setup == | ||
| + | |||
=== xinitrc === | === xinitrc === | ||
| + | |||
Edit ~/.xinitrc | Edit ~/.xinitrc | ||
<pre>exec i3</pre> | <pre>exec i3</pre> | ||
| Line 61: | Line 74: | ||
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1</pre> | exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1</pre> | ||
| − | === X11 and | + | <div id="X11 and xrandr"></div> |
| − | + | === X11 and xrandr === | |
| + | |||
| + | '''NOTE: RandR and Xinerama do not play together. Use one or the other.''' | ||
| + | |||
| + | For '''Nvidia''' users, see [http://i3wm.org/docs/multi-monitor.html The multi-monitor situation]. | ||
Make sure you have xrandr installed. If not | Make sure you have xrandr installed. If not | ||
| Line 102: | Line 119: | ||
...</pre> | ...</pre> | ||
In the "Screen" section, I have the Virtual Display set at 3840x1200. I originally tried 3840x1080, which would have been the resolution of both monitors combined horizontally, but as of yet I have not found a way to get that virtual resolution to work correctly in a dual monitor setup. Set at 3840x1200 I am able to have both monitors set as if they are connected side-by-side. | In the "Screen" section, I have the Virtual Display set at 3840x1200. I originally tried 3840x1080, which would have been the resolution of both monitors combined horizontally, but as of yet I have not found a way to get that virtual resolution to work correctly in a dual monitor setup. Set at 3840x1200 I am able to have both monitors set as if they are connected side-by-side. | ||
| + | |||
| + | This setup should allow for a minimal working i3. Start i3: | ||
| + | <pre># startx</pre> | ||
| + | If you see a blank screen with your mouse pointer, you are in the i3 environment. If not, double check your xorg.conf.d or xorg.conf files to make sure you have X set up correctly. | ||
| + | To bring up a terminal, you need to press Alt + Enter and at the prompt: | ||
| + | <pre># xrandr</pre> | ||
| + | Example xrandr output | ||
| + | <pre>Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 3840 x 1200 | ||
| + | DFP1 disconnected (normal left inverted right x axis y axis) | ||
| + | DFP2 disconnected (normal left inverted right x axis y axis) | ||
| + | DFP3 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm | ||
| + | 1920x1080 60.0*+ | ||
| + | 1600x1200 60.0 | ||
| + | 1680x1050 60.0 | ||
| + | 1400x1050 60.0 | ||
| + | 1600x900 60.0 | ||
| + | 1360x1024 60.0 | ||
| + | 1280x1024 75.0 60.0 | ||
| + | 1440x900 59.9 | ||
| + | 1280x960 60.0 | ||
| + | 1152x864 60.0 75.0 | ||
| + | 1280x768 60.0 | ||
| + | 1280x720 60.0 | ||
| + | 1024x768 75.0 70.1 60.0 | ||
| + | 800x600 72.2 75.0 60.3 56.2 | ||
| + | 640x480 75.0 72.8 67.0 59.9 | ||
| + | DFP4 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 509mm x 286mm | ||
| + | 1920x1080 60.0*+ | ||
| + | 1600x1200 60.0 | ||
| + | 1680x1050 60.0 | ||
| + | 1400x1050 60.0 | ||
| + | 1600x900 60.0 | ||
| + | 1360x1024 60.0 | ||
| + | 1280x1024 75.0 60.0 | ||
| + | 1440x900 59.9 | ||
| + | 1280x960 60.0 | ||
| + | 1152x864 60.0 75.0 | ||
| + | 1280x768 60.0 | ||
| + | 1280x720 60.0 | ||
| + | 1024x768 75.0 70.1 60.0 | ||
| + | 800x600 72.2 75.0 60.3 56.2 | ||
| + | 640x480 75.0 72.8 67.0 59.9 | ||
| + | CRT1 disconnected (normal left inverted right x axis y axis)</pre> | ||
| + | Keep track of the types of connections. In this example, DFP3 and DFP4 are connected and will be used in the i3 config to specify on which monitors certain applications will be output. | ||
| + | |||
| + | ==== Setting up the dual-monitors ==== | ||
| + | The easiest way is to open a terminal (Alt + Enter) | ||
| + | <pre># arandr</pre> | ||
| + | This will bring up the GUI for setting xrandr. You will see boxes labeled as the same output connection when you ran xrandr. Move these boxes to the layout that you want and click apply. Be sure to save this file to be used later in the i3 config. | ||
| + | The manual way to set up xrandr is a little more involved. I would suggest reading the man page on xrandr before setting up xrandr. In the case of the example xrandr output, you would set up xrandr in a terminal | ||
| + | <pre># xrandr --output CRT1 --off --output DFP1 --off --output DFP2 --off --output DFP3 --mode 1920x1080 --pos 0x0 --rotate normal --output DFP4 --mode 1920x1080 --pos 1920x0 --rotate normal</pre> | ||
| + | If you set up xrandr in this manner, be sure to open your favorite editor and create a bash file that is executable to be run in the i3config. | ||
| + | |||
| + | Example bash script for xrandr saved as screenlayout.sh. Remember to make sure that this .sh file is executable. | ||
| + | <pre> #!/bin/sh | ||
| + | xrandr --output CRT1 --off --output DFP1 --off --output DFP2 --off --output DFP3 --mode 1920x1080 --pos 0x0 --rotate normal --output DFP4 --mode 1920x1080 --pos 1920x0 --rotate normal</pre> | ||
| + | I have not tested anything more than a dual-monitor setup as of yet, but I imagine that with xrandr, a multiple-monitor setup should be fairly easy. | ||
| + | |||
| + | If everything has went well, you should now have i3 displayed on all monitors and can switch back and forth between the monitors using keybindings or the mouse. | ||
| + | |||
=== i3 config === | === i3 config === | ||
| + | The i3 configuration file can be found in /etc/i3/config, but I suggest that you copy the file into a local ~/.i3 directory. | ||
| + | <pre># mkdir -p ~/.i3 && cp /etc/i3/config ~/.i3/config</pre> | ||
| + | Open up ~/i3/config in your editor of choice. | ||
| + | Sample ~/i3/config | ||
| + | <pre> | ||
| + | set $mod Mod1 | ||
| + | |||
| + | ######################################################## | ||
| + | ######## Autostart ######## | ||
| + | ######################################################## | ||
| + | exec ~/.screenlayout/dualdtop.sh | ||
| + | exec chromium-browser | ||
| + | exec gvim | ||
| + | exec volumeicon | ||
| + | exec parcellite | ||
| + | exec dropbox | ||
| + | |||
| + | ## Workspaces | ||
| + | workspace 1 "web" | ||
| + | workspace 2 "chat" | ||
| + | workspace 3 "ranger" | ||
| + | workspace 4 "vim" | ||
| + | workspace 5 "terms" | ||
| + | workspace 6 "mplayer" | ||
| + | workspace 7 "email" | ||
| + | |||
| + | ## Assign workspaces to programs | ||
| + | assign [class="^Chromium-browser$" instance="^chromium-browser$"] → web | ||
| + | assign [class="^Gvim$" instance="^gvim$"] → vim | ||
| + | assign [class="^MPlayer$" instance="^gl$"] → mplayer | ||
| + | assign [class="^Claws-mail$" instance="^claws-mail$"] → email | ||
| + | |||
| + | ## Output certain workspaces | ||
| + | workspace "web" output DFP3 | ||
| + | workspace "chat" output DFP4 | ||
| + | workspace "ranger" output DFP3 | ||
| + | workspace "vim" output DFP4 | ||
| + | workspace "mplayer" output DFP3 | ||
| + | workspace "terms" output DFP4 | ||
| + | workspace "email" output DFP3 | ||
| + | |||
| + | # switch to workspace | ||
| + | bindsym Mod1+1 workspace "web" | ||
| + | bindsym Mod1+2 workspace "chat" | ||
| + | bindsym Mod1+3 workspace "vim" | ||
| + | bindsym Mod1+4 workspace "ranger" | ||
| + | bindsym Mod1+5 workspace "terms" | ||
| + | bindsym Mod1+6 workspace "mplayer" | ||
| + | bindsym Mod1+7 workspace "email" | ||
| + | bindsym Mod1+8 workspace 8 | ||
| + | bindsym Mod1+9 workspace 9 | ||
| + | bindsym Mod1+0 workspace 10 | ||
| + | |||
| + | # move focused container to workspace | ||
| + | bindsym Mod1+Shift+1 move workspace 1 | ||
| + | bindsym Mod1+Shift+2 move workspace 2 | ||
| + | bindsym Mod1+Shift+3 move workspace 3 | ||
| + | bindsym Mod1+Shift+4 move workspace 4 | ||
| + | bindsym Mod1+Shift+5 move workspace 5 | ||
| + | bindsym Mod1+Shift+6 move workspace 6 | ||
| + | bindsym Mod1+Shift+7 move workspace 7 | ||
| + | bindsym Mod1+Shift+8 move workspace 8 | ||
| + | bindsym Mod1+Shift+9 move workspace 9 | ||
| + | bindsym Mod1+Shift+0 move workspace 10 | ||
| + | |||
| + | # Window border style: | ||
| + | # normal: border normal, with window title bar; | ||
| + | # none: no border or window title bar; | ||
| + | # 1pixel: 1 pixel border. | ||
| + | new_window 1pixel | ||
| + | bindsym $mod+t border normal | ||
| + | bindsym $mod+y border 1pixel | ||
| + | bindsym $mod+u border none | ||
| + | |||
| + | # font for window titles. ISO 10646 = Unicode | ||
| + | font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 | ||
| + | |||
| + | # Use Mouse+$mod to drag floating windows to their wanted position | ||
| + | floating_modifier $mod | ||
| + | |||
| + | # start a terminal | ||
| + | bindsym $mod+Return exec i3-sensible-terminal | ||
| + | |||
| + | # kill focused window | ||
| + | bindsym $mod+Shift+Q kill | ||
| + | |||
| + | # start dmenu (a program launcher) | ||
| + | bindsym $mod+d exec dmenu_run | ||
| + | |||
| + | # change focus | ||
| + | bindsym $mod+j focus left | ||
| + | bindsym $mod+k focus down | ||
| + | bindsym $mod+l focus up | ||
| + | bindsym $mod+semicolon focus right | ||
| + | |||
| + | # alternatively, you can use the cursor keys: | ||
| + | bindsym $mod+Left focus left | ||
| + | bindsym $mod+Down focus down | ||
| + | bindsym $mod+Up focus up | ||
| + | bindsym $mod+Right focus right | ||
| + | |||
| + | # move focused window | ||
| + | bindsym $mod+Shift+J move left | ||
| + | bindsym $mod+Shift+K move down | ||
| + | bindsym $mod+Shift+L move up | ||
| + | bindsym $mod+Shift+colon move right | ||
| + | |||
| + | # alternatively, you can use the cursor keys: | ||
| + | bindsym $mod+Shift+Left move left | ||
| + | bindsym $mod+Shift+Down move down | ||
| + | bindsym $mod+Shift+Up move up | ||
| + | bindsym $mod+Shift+Right move right | ||
| + | |||
| + | # split in horizontal orientation | ||
| + | bindsym $mod+h split h | ||
| + | |||
| + | # split in vertical orientation | ||
| + | bindsym $mod+v split v | ||
| + | |||
| + | # enter fullscreen mode for the focused container | ||
| + | bindsym $mod+f fullscreen | ||
| + | |||
| + | # change container layout (stacked, tabbed, default) | ||
| + | bindsym $mod+s layout stacking | ||
| + | bindsym $mod+w layout tabbed | ||
| + | bindsym $mod+e layout default | ||
| + | |||
| + | # toggle tiling / floating | ||
| + | bindsym $mod+Shift+space floating toggle | ||
| + | |||
| + | # change focus between tiling / floating windows | ||
| + | bindsym $mod+space focus mode_toggle | ||
| + | |||
| + | # focus the parent container | ||
| + | bindsym $mod+a focus parent | ||
| + | |||
| + | # focus the child container | ||
| + | #bindcode $mod+d focus child | ||
| + | |||
| + | # reload the configuration file | ||
| + | bindsym $mod+Shift+C reload | ||
| + | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) | ||
| + | bindsym $mod+Shift+R restart | ||
| + | # exit i3 (logs you out of your X session) | ||
| + | bindsym $mod+Shift+E exit | ||
| + | |||
| + | # resize window (you can also use the mouse for that) | ||
| + | mode "resize" { | ||
| + | # These bindings trigger as soon as you enter the resize mode | ||
| + | # They resize the border in the direction you pressed, e.g. | ||
| + | # when pressing left, the window is resized so that it has | ||
| + | # more space on its left | ||
| + | |||
| + | bindsym j resize shrink left 10 px or 10 ppt | ||
| + | bindsym Shift+J resize grow left 10 px or 10 ppt | ||
| + | |||
| + | bindsym k resize shrink down 10 px or 10 ppt | ||
| + | bindsym Shift+K resize grow down 10 px or 10 ppt | ||
| + | |||
| + | bindsym l resize shrink up 10 px or 10 ppt | ||
| + | bindsym Shift+L resize grow up 10 px or 10 ppt | ||
| + | |||
| + | bindsym semicolon resize shrink right 10 px or 10 ppt | ||
| + | bindsym Shift+colon resize grow right 10 px or 10 ppt | ||
| + | |||
| + | # same bindings, but for the arrow keys | ||
| + | bindsym Left resize shrink left 10 px or 10 ppt | ||
| + | bindsym Shift+Left resize grow left 10 px or 10 ppt | ||
| + | |||
| + | bindsym Down resize shrink down 10 px or 10 ppt | ||
| + | bindsym Shift+Down resize grow down 10 px or 10 ppt | ||
| + | |||
| + | bindsym Up resize shrink up 10 px or 10 ppt | ||
| + | bindsym Shift+Up resize grow up 10 px or 10 ppt | ||
| + | |||
| + | bindsym Right resize shrink right 10 px or 10 ppt | ||
| + | bindsym Shift+Right resize grow right 10 px or 10 ppt | ||
| + | |||
| + | # back to normal: Enter or Escape | ||
| + | bindsym Return mode "default" | ||
| + | bindsym Escape mode "default" | ||
| + | } | ||
| + | |||
| + | bindsym $mod+r mode "resize" | ||
| + | |||
| + | # Start i3bar to display a workspace bar (plus the system information i3status | ||
| + | # finds out, if available) | ||
| + | bar { | ||
| + | output DFP3 | ||
| + | output DFP4 | ||
| + | status_command i3status -c ~/.i3status.conf | ||
| + | position top | ||
| + | mode dock | ||
| + | workspace_buttons yes | ||
| + | tray_output DFP3 | ||
| + | |||
| + | font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 | ||
| + | |||
| + | colors { | ||
| + | background #000000 | ||
| + | statusline #FFFFFF | ||
| + | |||
| + | focused_workspace #ffffff #285577 | ||
| + | active_workspace #ffffff #333333 | ||
| + | inactive_workspace #888888 #222222 | ||
| + | urgent_workspace #ffffff #900000 | ||
| + | } | ||
| + | }</pre> | ||
| + | The keybinding sections are all part of the default i3/config. I changed the workspace sections to my desire and also added the window border section so that I can change window borders when necessary (usually in the case that I switch a window from tiled to floating and wish to drag it to another workspace or just to move it around the current workspace. | ||
=== i3-sensible-editor === | === i3-sensible-editor === | ||
| + | |||
=== i3-sensible-terminal === | === i3-sensible-terminal === | ||
| + | |||
=== i3-sensible-pager === | === i3-sensible-pager === | ||
| + | |||
=== i3status === | === i3status === | ||
| + | == Default Keybindings == | ||
| + | |||
| + | {| border="2" style="text-align:center;" | ||
| + | |Alt + Enter | ||
| + | |Open terminal | ||
| + | |- | ||
| + | |Alt + A | ||
| + | |Focus Parent | ||
| + | |- | ||
| + | |Alt + S | ||
| + | |Stacked Layout | ||
| + | |- | ||
| + | |Alt + W | ||
| + | |Tabbed Layout | ||
| + | |- | ||
| + | |Alt + E | ||
| + | |Default Layout | ||
| + | |- | ||
| + | |Alt + SpaceBar | ||
| + | |Focus tiling/floating | ||
| + | |- | ||
| + | |Alt + D | ||
| + | |dmenu | ||
| + | |- | ||
| + | |Alt + H | ||
| + | |Split Horizontal | ||
| + | |- | ||
| + | |Alt + V | ||
| + | |Split Vertically | ||
| + | |- | ||
| + | |Alt + J | ||
| + | |Left | ||
| + | |- | ||
| + | |Alt + K | ||
| + | |Down | ||
| + | |- | ||
| + | |Alt + J | ||
| + | |Up | ||
| + | |- | ||
| + | |Alt + ; | ||
| + | |Right | ||
| + | |- | ||
| + | |Alt + Shift + Q | ||
| + | |Kill window | ||
| + | |- | ||
| + | |Alt + Shift + E | ||
| + | |Exit i3 | ||
| + | |- | ||
| + | |Alt + Shift + R | ||
| + | |Restart i3 (reloads i3config without exiting i3) | ||
| + | |- | ||
| + | |Alt + Shift + J | ||
| + | |Move left | ||
| + | |- | ||
| + | |Alt + Shift + K | ||
| + | |Move down | ||
| + | |- | ||
| + | |Alt + Shift + L | ||
| + | |Move up | ||
| + | |- | ||
| + | |Alt + Shift + : | ||
| + | |Move right | ||
| + | |- | ||
| + | |Alt + Shift + SpaceBar | ||
| + | |Toggle tiling/floating | ||
| + | |} | ||
== Troubleshooting == | == Troubleshooting == | ||
| + | |||
=== i3status === | === i3status === | ||
| + | |||
In the case such as mine, i3status did not work out of the box. The permissions were set at -r-xr-x--- and when run as non-root, zsh would return with "permission denied". | In the case such as mine, i3status did not work out of the box. The permissions were set at -r-xr-x--- and when run as non-root, zsh would return with "permission denied". | ||
If i3status does not work for you, this can be easily corrected by changing the permissions. | If i3status does not work for you, this can be easily corrected by changing the permissions. | ||
<pre># sudo chmod 755 /usr/bin/i3status</pre> | <pre># sudo chmod 755 /usr/bin/i3status</pre> | ||
Revision as of 01:59, 4 January 2012
Work in progress. Page will hopefully be completed soon
Contents |
Introduction
i3 is a tiling window manager that is based upon experiences the developers shared while attempting to fix/hack wmii. i3 has the ability for either floating windows, which you can resize and move, and tiling windows. i3 uses a tree as a data structure to allow for more flexibility. i3 defaults with home-row key-bindings which are quick and easy to get beginner's off the ground.
NOTE: This wiki is made following the steps produced to get a working i3 using xrandr instead of xinerama, ATI proprietary drivers instead of radeon drivers, a dual-monitor setup, and no login manager. For Nvidia and Twinview users, a link is supplied in X11 and xrandr. Xinerama was initially used and worked in the dual-monitor setup so it possible to substitute xinerama for xrandr with minimal changes.
Documentation
Websites
Man pages
- i3
- i3-config-wizard
- i3-input
- i3-migrate-config-to-v4
- i3-msg
- i3-nagbar
- i3-sensible-editor
- i3-sensible-pager
- i3-sensible-terminal
- i3-wsbar
- i3bar
- i3lock
- i3status
Installation
Portage
The easiest and quickest way:
# emerge -avt x11-wm/i3
Manual
Tarball
Download the latest version from the i3 website.
# cd /PATH/TO/TARBALL # make # sudo make install
Git
# git clone git://code.i3wm.org/i3 # cd i3 # make # sudo make install
Setup
xinitrc
Edit ~/.xinitrc
exec i3
For i3 logging, edit ~/.xinitrc
exec i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
If you are using Nvidia or for some reason don't use xrandr, edit ~/.xinitrc
exec i3 --force-xinerama
and nvidia with logging:
exec i3 --force-xinerama -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
Example ~/.xinitrc
#!/bin/zsh xrdb -merge ~/.Xresources exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
X11 and xrandr
NOTE: RandR and Xinerama do not play together. Use one or the other.
For Nvidia users, see The multi-monitor situation.
Make sure you have xrandr installed. If not
# emerge -avt x11-apps/xrandr
and if you want a GUI with xrandr
# emerge -avt x11-misc/arandr
Example /etc/X11/xorg.conf.d/30-screen.conf
... Section "Monitor" Identifier "Monitor0" Option "DPMS" "true" Option "Primary" "true" EndSection Section "Monitor" Identifier "Monitor1" Option "DPMS" "true" Option "RightOf" "Monitor0" Option "Primary" "false" EndSection Section "Device" Identifier "ATI HD 6870" Driver "fglrx" Option "Monitor-DVI-I" "Monitor0" Option "Monitor-DVI-D" "Monitor1" Option "TexturedVideo" "on" EndSection Section "Screen" Identifier "Default Screen" Device "ATI HD 6870" DefaultDepth 24 SubSection "Display" Depth 24 Virtual 3840 1200 EndSubSection EndSection ...
In the "Screen" section, I have the Virtual Display set at 3840x1200. I originally tried 3840x1080, which would have been the resolution of both monitors combined horizontally, but as of yet I have not found a way to get that virtual resolution to work correctly in a dual monitor setup. Set at 3840x1200 I am able to have both monitors set as if they are connected side-by-side.
This setup should allow for a minimal working i3. Start i3:
# startx
If you see a blank screen with your mouse pointer, you are in the i3 environment. If not, double check your xorg.conf.d or xorg.conf files to make sure you have X set up correctly. To bring up a terminal, you need to press Alt + Enter and at the prompt:
# xrandr
Example xrandr output
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 3840 x 1200 DFP1 disconnected (normal left inverted right x axis y axis) DFP2 disconnected (normal left inverted right x axis y axis) DFP3 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm 1920x1080 60.0*+ 1600x1200 60.0 1680x1050 60.0 1400x1050 60.0 1600x900 60.0 1360x1024 60.0 1280x1024 75.0 60.0 1440x900 59.9 1280x960 60.0 1152x864 60.0 75.0 1280x768 60.0 1280x720 60.0 1024x768 75.0 70.1 60.0 800x600 72.2 75.0 60.3 56.2 640x480 75.0 72.8 67.0 59.9 DFP4 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 509mm x 286mm 1920x1080 60.0*+ 1600x1200 60.0 1680x1050 60.0 1400x1050 60.0 1600x900 60.0 1360x1024 60.0 1280x1024 75.0 60.0 1440x900 59.9 1280x960 60.0 1152x864 60.0 75.0 1280x768 60.0 1280x720 60.0 1024x768 75.0 70.1 60.0 800x600 72.2 75.0 60.3 56.2 640x480 75.0 72.8 67.0 59.9 CRT1 disconnected (normal left inverted right x axis y axis)
Keep track of the types of connections. In this example, DFP3 and DFP4 are connected and will be used in the i3 config to specify on which monitors certain applications will be output.
Setting up the dual-monitors
The easiest way is to open a terminal (Alt + Enter)
# arandr
This will bring up the GUI for setting xrandr. You will see boxes labeled as the same output connection when you ran xrandr. Move these boxes to the layout that you want and click apply. Be sure to save this file to be used later in the i3 config. The manual way to set up xrandr is a little more involved. I would suggest reading the man page on xrandr before setting up xrandr. In the case of the example xrandr output, you would set up xrandr in a terminal
# xrandr --output CRT1 --off --output DFP1 --off --output DFP2 --off --output DFP3 --mode 1920x1080 --pos 0x0 --rotate normal --output DFP4 --mode 1920x1080 --pos 1920x0 --rotate normal
If you set up xrandr in this manner, be sure to open your favorite editor and create a bash file that is executable to be run in the i3config.
Example bash script for xrandr saved as screenlayout.sh. Remember to make sure that this .sh file is executable.
#!/bin/sh xrandr --output CRT1 --off --output DFP1 --off --output DFP2 --off --output DFP3 --mode 1920x1080 --pos 0x0 --rotate normal --output DFP4 --mode 1920x1080 --pos 1920x0 --rotate normal
I have not tested anything more than a dual-monitor setup as of yet, but I imagine that with xrandr, a multiple-monitor setup should be fairly easy.
If everything has went well, you should now have i3 displayed on all monitors and can switch back and forth between the monitors using keybindings or the mouse.
i3 config
The i3 configuration file can be found in /etc/i3/config, but I suggest that you copy the file into a local ~/.i3 directory.
# mkdir -p ~/.i3 && cp /etc/i3/config ~/.i3/config
Open up ~/i3/config in your editor of choice. Sample ~/i3/config
set $mod Mod1
########################################################
######## Autostart ########
########################################################
exec ~/.screenlayout/dualdtop.sh
exec chromium-browser
exec gvim
exec volumeicon
exec parcellite
exec dropbox
## Workspaces
workspace 1 "web"
workspace 2 "chat"
workspace 3 "ranger"
workspace 4 "vim"
workspace 5 "terms"
workspace 6 "mplayer"
workspace 7 "email"
## Assign workspaces to programs
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → web
assign [class="^Gvim$" instance="^gvim$"] → vim
assign [class="^MPlayer$" instance="^gl$"] → mplayer
assign [class="^Claws-mail$" instance="^claws-mail$"] → email
## Output certain workspaces
workspace "web" output DFP3
workspace "chat" output DFP4
workspace "ranger" output DFP3
workspace "vim" output DFP4
workspace "mplayer" output DFP3
workspace "terms" output DFP4
workspace "email" output DFP3
# switch to workspace
bindsym Mod1+1 workspace "web"
bindsym Mod1+2 workspace "chat"
bindsym Mod1+3 workspace "vim"
bindsym Mod1+4 workspace "ranger"
bindsym Mod1+5 workspace "terms"
bindsym Mod1+6 workspace "mplayer"
bindsym Mod1+7 workspace "email"
bindsym Mod1+8 workspace 8
bindsym Mod1+9 workspace 9
bindsym Mod1+0 workspace 10
# move focused container to workspace
bindsym Mod1+Shift+1 move workspace 1
bindsym Mod1+Shift+2 move workspace 2
bindsym Mod1+Shift+3 move workspace 3
bindsym Mod1+Shift+4 move workspace 4
bindsym Mod1+Shift+5 move workspace 5
bindsym Mod1+Shift+6 move workspace 6
bindsym Mod1+Shift+7 move workspace 7
bindsym Mod1+Shift+8 move workspace 8
bindsym Mod1+Shift+9 move workspace 9
bindsym Mod1+Shift+0 move workspace 10
# Window border style:
# normal: border normal, with window title bar;
# none: no border or window title bar;
# 1pixel: 1 pixel border.
new_window 1pixel
bindsym $mod+t border normal
bindsym $mod+y border 1pixel
bindsym $mod+u border none
# font for window titles. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+Q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, default)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindcode $mod+d focus child
# reload the configuration file
bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+E exit
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# They resize the border in the direction you pressed, e.g.
# when pressing left, the window is resized so that it has
# more space on its left
bindsym j resize shrink left 10 px or 10 ppt
bindsym Shift+J resize grow left 10 px or 10 ppt
bindsym k resize shrink down 10 px or 10 ppt
bindsym Shift+K resize grow down 10 px or 10 ppt
bindsym l resize shrink up 10 px or 10 ppt
bindsym Shift+L resize grow up 10 px or 10 ppt
bindsym semicolon resize shrink right 10 px or 10 ppt
bindsym Shift+colon resize grow right 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink left 10 px or 10 ppt
bindsym Shift+Left resize grow left 10 px or 10 ppt
bindsym Down resize shrink down 10 px or 10 ppt
bindsym Shift+Down resize grow down 10 px or 10 ppt
bindsym Up resize shrink up 10 px or 10 ppt
bindsym Shift+Up resize grow up 10 px or 10 ppt
bindsym Right resize shrink right 10 px or 10 ppt
bindsym Shift+Right resize grow right 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
output DFP3
output DFP4
status_command i3status -c ~/.i3status.conf
position top
mode dock
workspace_buttons yes
tray_output DFP3
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
colors {
background #000000
statusline #FFFFFF
focused_workspace #ffffff #285577
active_workspace #ffffff #333333
inactive_workspace #888888 #222222
urgent_workspace #ffffff #900000
}
}
The keybinding sections are all part of the default i3/config. I changed the workspace sections to my desire and also added the window border section so that I can change window borders when necessary (usually in the case that I switch a window from tiled to floating and wish to drag it to another workspace or just to move it around the current workspace.
i3-sensible-editor
i3-sensible-terminal
i3-sensible-pager
i3status
Default Keybindings
| Alt + Enter | Open terminal |
| Alt + A | Focus Parent |
| Alt + S | Stacked Layout |
| Alt + W | Tabbed Layout |
| Alt + E | Default Layout |
| Alt + SpaceBar | Focus tiling/floating |
| Alt + D | dmenu |
| Alt + H | Split Horizontal |
| Alt + V | Split Vertically |
| Alt + J | Left |
| Alt + K | Down |
| Alt + J | Up |
| Alt + ; | Right |
| Alt + Shift + Q | Kill window |
| Alt + Shift + E | Exit i3 |
| Alt + Shift + R | Restart i3 (reloads i3config without exiting i3) |
| Alt + Shift + J | Move left |
| Alt + Shift + K | Move down |
| Alt + Shift + L | Move up |
| Alt + Shift + : | Move right |
| Alt + Shift + SpaceBar | Toggle tiling/floating |
Troubleshooting
i3status
In the case such as mine, i3status did not work out of the box. The permissions were set at -r-xr-x--- and when run as non-root, zsh would return with "permission denied". If i3status does not work for you, this can be easily corrected by changing the permissions.
# sudo chmod 755 /usr/bin/i3status