(gdb) break *0x972

Debugging, GNU± Linux and WebHosting and ... and ...

[Dev-tool configuration] i3 Window Manager

Since a few years, I stopped using a traditional desktop manager like Gnome or KDE (maybe when Gnome switch to version 3?). I'm now addicted to my tiling window manager, i3. I3 manages only the windows on my screen, but not the desktop. Hence, when there's no window on my screen ... it's black! That could be improved, but most of the time, I have a window, so it doesn't matter. But no clickable icon, no clickable toolbar, just windows!

A tiling window manager (WM) gives the maximum room to each window, either by tabbing them, like in firefox, or by splitting (and sub-spliting) the screen horizontally or vertically:

Caught working hard

As there are no icons or clickable toolbar, everything is done with keyboard shortcuts. The learning curve, at the beginning, is a bit steep I admit! But one you get it, it's really nice to use!

Let's dive step-by-step into my configuration file:

Mod4 is 'Windows' key

Start applications

  • Mod4+Shift is the prefix to start applications. Mod4+Control is for alternative starts

    # Application shortcuts
    set $Mod_app Mod4+Shift
    set $Mod_app_alt Mod4+Control
    
  • Common tools:

    bindsym $Mod_app+f exec firefox
    bindsym $Mod_app+t exec thunderbird
    
    bindsym $Mod_app+m exec emacsclient -c # emacsclient needs an `emacs --daemon`
    bindsym $Mod_app_alt+m exec emacs # safe start, but takes longer
    
    # Start a terminal (urxvt client)
    bindsym $Mod_app+Return exec urxvtc # needs `urxvtd`
    bindsym $Mod_app_alt+Return exec urxvt # failsafe terminal
    
  • Force floating window (I guess these window don't respect all the protocols, so they are seen as primary windows, instead of floating boxes):

    for_window [class="Nautilus" instance="file_progress"] floating enable
    for_window [class="Xmessage"] floating enable
    for_window [title="Find"] floating enable
    
  • Helpers:

    bindsym Mod4+l exec i3lock -i /home/kevin/.i3/lock.png # locks the screen with a background image
    bindsym Mod4+F2 exec dmenu_run
    
    # Kill the current window
    bindsym $Mod_app+q kill # close the current 
    

See also dmenu_run, i3lock. I'll explain urxvtc and emacsclient in another post.

Window management

  • Window layout

    # Stacking / Tabbed / Default layout
    workspace_layout tabbed
    
    bindsym Mod4+s layout stacking
    bindsym Mod4+t layout tabbed
    bindsym Mod4+d layout default
    
  • Splitting windows

    default_orientation vertical
    # Split horizonally or vertically a window
    # *I can't help but consider than vertical split means that the window split should be vertical,
    # and the sub-windows side-by-side*, so I reversed h and v
    bindsym Mod4+h split vertical
    bindsym Mod4+v split horizontal
    
  • Moving windows

    set $Mod_move Mod4+Shift
    bindsym $Mod_move+Left move left
    bindsym $Mod_move+Right move right
    bindsym $Mod_move+Down move down
    bindsym $Mod_move+Up move up
    
    bindsym Mod4+f fullscreen
    bindsym Mod4+Mod1+f fullscreen global # on all screens
    
    # Toggle tiling/floating of the current window
    bindsym $Mod_move+space floating toggle
    
  • Changing the focus

    bindsym Mod4+Left focus left
    bindsym Mod4+Right focus right
    bindsym Mod4+Down focus down
    bindsym Mod4+Up focus up
    
  • Scratchpad (=invisible place)

    bindsym F12 move scratchpad
    bindsym F11 scratchpad show
    
  • Workspaces

    bindcode $Mod_move+10 move workspace 1 # touch 1
    bindcode $Mod_move+11 move workspace 2 # code for touch n = 9+n
    ...
    bindcode $Mod_move+86 move workspace next # touch +, found with `xev`
    bindcode $Mod_move+82 move workspace prev # touch -
    
  • Window resize

    # Window resize (although mouse is more convenient!)
    mode "resize" {
      bindsym Left resize grow left 10 px
      bindsym Shift+Left resize shrink left 10 px
    
      bindsym Down resize grow down 10 px
      bindsym Shift+Down resize shrink down 10 px
    
      bindsym Up resize grow up 10 px
      bindsym Shift+Up resize shrink up 10 px
    
      bindsym Right resize grow right 10 px
      bindsym Shift+Right resize shrink right 10 px
    
      #Enter to return to default
      bindsym Return mode "default"
    }
    

Misc.

  • Sound configuration

    set $Mod_sound Mod4+Mod1 #Win+Alt
    bindsym  $Mod_sound+m  exec amixer sset Master toggle
    bindcode $Mod_sound+82 exec amixer set Master 1%- # touch +
    bindcode $Mod_sound+86 exec amixer set Master 1%+ # touch -
    
    bindsym  XF86AudioMute exec amixer sset Master toggle # laptop multimedia keys
    bindsym  XF86AudioLowerVolume exec amixer set Master 1%-
    bindsym  XF86AudioRaiseVolume exec amixer set Master 1%+
    
    exec amixer sset Master mute # set to mute after boot sequence
    
  • Keyboard map (lang) configuration

    bindsym Mod4+Ctrl+f exec setxkbmap fr
    bindsym Mod4+Ctrl+u exec setxkbmap us
    
  • Borderless window or not

    hide_edge_borders both # by default, no side borders
    bindsym Mod4+p border normal
    bindsym Mod4+o border none # includes no window title
    
  • Restart and reload i3

    set $Mod_sys Mod4+Shift+Control
    bindsym $Mod_sys+e restart
    bindsym $Mod_sys+r reload
    
  • Home-made status bar (I'll put it online and explain it later)

    bindsym Mod4+Shift+w exec ~/.i3/i3status.py --kill --ws2
    bindsym Mod4+Ctrl+w exec ~/.i3/i3status.py --kill --ws1
    bar {
        position bottom
        mode hide
    }
    exec ~/.i3/i3status.py
    

Enjoy, i3 is a great tool, especially for development with multiple screens!