Skip to content

i3 config example

budRich edited this page Jul 11, 2023 · 6 revisions

Below is the default i3 configuration file, with some keybindings replaced by their i3ass equivalents. Its a good starting point if you want to try i3ass and i3fyra.

# Mod4 also known as the windows manager key
set $mod Mod4

set $left  Left
set $down  Down
set $up    Up
set $right Right

# hackerman VI-navigation (enable with caution)
# set $left  h
# set $down  j
# set $up    k
# set $right l

# bloated workspace name variables from the OG config
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

# default/starting workspace (without this line, 
# "zen" will be the default workspace).
# primary is the name of the output.
workspace $ws1 output primary

# toggle floating state            | i3fyra
# -----------------------------------------------
bindsym $mod+Shift+space      exec --no-startup-id i3fyra --float
# making a floating window tiled with the keybinding
# above will automatically enable the i3fyra layout
# on the active workspace.

# splitsizes in the i3fyra layout
# -----------------------------------------------
set $layout 'AB=-350 AC=220 BD=252'

# by executing below command with i3 the layout
# will be configured before it is created
exec --no-startup-id i3fyra --layout $layout

# use this keybinding to restore the layout
bindsym $mod+p exec --no-startup-id i3fyra --layout $layout         

# change focus                     | i3viswiz
# -----------------------------------------------
bindsym $mod+$left            exec --no-startup-id i3viswiz left
bindsym $mod+$down            exec --no-startup-id i3viswiz down
bindsym $mod+$up              exec --no-startup-id i3viswiz up
bindsym $mod+$right           exec --no-startup-id i3viswiz right

# focus within a group (flip tabs) | i3flip
# -----------------------------------------------
bindsym $mod+Tab              exec --no-startup-id i3flip next
bindsym $mod+Shift+Tab        exec --no-startup-id i3flip perv

# move within a group              | i3flip --move
# -----------------------------------------------
bindsym $mod+w                exec --no-startup-id i3flip --move next
bindsym $mod+q                exec --no-startup-id i3flip --move perv

# zentered container and workspace | i3zen
# if the window is already there, move it back to
# where it came from.
bindsym $mod+z exec --no-startup-id i3zen --workspace zen

# focus the zen workspace
bindsym $mod+Shift+z workspace zen

# move a window                   | i3Kornhe move
# -----------------------------------------------
bindsym $mod+Shift+$left      exec --no-startup-id i3Kornhe move --speed 0 left
bindsym $mod+Shift+$down      exec --no-startup-id i3Kornhe move --speed 0 down
bindsym $mod+Shift+$up        exec --no-startup-id i3Kornhe move --speed 0 up
bindsym $mod+Shift+$right     exec --no-startup-id i3Kornhe move --speed 0 right

# resize a window                 | i3Kornhe size
# -----------------------------------------------
bindsym $mod+Control+$left    exec --no-startup-id i3Kornhe size --speed 30 left
bindsym $mod+Control+$down    exec --no-startup-id i3Kornhe size --speed 30 down
bindsym $mod+Control+$up      exec --no-startup-id i3Kornhe size --speed 30 up
bindsym $mod+Control+$right   exec --no-startup-id i3Kornhe size --speed 30 right

# "sizemode" is needed for i3Kornhe to work. It is
# entered automatically if the window is floating
# and i3Kornhe move/size is executed
mode "sizemode" {

  bindsym $left               exec --no-startup-id i3Kornhe --speed 30 left
  bindsym $down               exec --no-startup-id i3Kornhe --speed 30 down
  bindsym $up                 exec --no-startup-id i3Kornhe --speed 30 up
  bindsym $right              exec --no-startup-id i3Kornhe --speed 30 right

  bindsym Shift+$left         exec --no-startup-id i3Kornhe --speed 5 left
  bindsym Shift+$down         exec --no-startup-id i3Kornhe --speed 5 down
  bindsym Shift+$up           exec --no-startup-id i3Kornhe --speed 5 up
  bindsym Shift+$right        exec --no-startup-id i3Kornhe --speed 5 right

  bindsym $mod+Control+$left  exec --no-startup-id i3Kornhe size left
  bindsym $mod+Control+$down  exec --no-startup-id i3Kornhe size down
  bindsym $mod+Control+$up    exec --no-startup-id i3Kornhe size up
  bindsym $mod+Control+$right exec --no-startup-id i3Kornhe size right

  bindsym m exec --no-startup-id i3Kornhe move --speed 0 left

  bindsym 1 exec --no-startup-id i3Kornhe 1
  bindsym 2 exec --no-startup-id i3Kornhe 2
  bindsym 3 exec --no-startup-id i3Kornhe 3
  bindsym 4 exec --no-startup-id i3Kornhe 4
  bindsym 5 exec --no-startup-id i3Kornhe 5
  bindsym 6 exec --no-startup-id i3Kornhe 6
  bindsym 7 exec --no-startup-id i3Kornhe 7
  bindsym 8 exec --no-startup-id i3Kornhe 8
  bindsym 9 exec --no-startup-id i3Kornhe 9

  bindsym Escape exec --no-startup-id i3Kornhe x
}


# combine all layout in $mod+e , frees up $mod+w
# (used for: i3flip --move next)
# bindsym $mod+s layout stacking
# bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle splith splitv tabbed stacking



# untouched from the default config:
# ==================================

font pango:monospace 8

exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
exec --no-startup-id nm-applet

set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

bindsym $mod+Return exec i3-sensible-terminal

bindsym $mod+Shift+q kill

bindsym $mod+d exec --no-startup-id dmenu_run

# when using hackerman VI-navigation you will need to
# change the binding below ($mod+h == $mod+$left)
bindsym $mod+h split h
bindsym $mod+v split v

bindsym $mod+a focus parent

bindsym $mod+space focus mode_toggle

bindsym $mod+f fullscreen toggle



bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10

bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10

bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

bar {
        status_command i3status
}




# below are default bindings replaced by i3ass
# ============================================

# floating toggle --> i3fyra --float
# -----------------------------------
# bindsym $mod+Shift+space floating toggle

# focus --> i3viswiz
# -----------------------------------------------

# bindsym $mod+$left   focus left
# bindsym $mod+$down   focus down
# bindsym $mod+$up     focus up
# bindsym $mod+$right  focus right

# move/resize --> i3Kornhe 
# -----------------------------------------------

# bindsym $mod+Shift+$left  move left
# bindsym $mod+Shift+$down  move down
# bindsym $mod+Shift+$up    move up
# bindsym $mod+Shift+$right move right

# mode "resize" {
        # bindsym $left resize shrink width 10 px or 10 ppt
        # bindsym $up resize grow height 10 px or 10 ppt
        # bindsym $down resize shrink height 10 px or 10 ppt
        # bindsym $right resize grow width 10 px or 10 ppt

        # bindsym Return mode "default"
        # bindsym Escape mode "default"
        # bindsym $mod+r mode "default"
# }

# No need for a separate bindin to enter the mode 
# -----------------------------------------------
# bindsym $mod+r mode "resize"

# Use one keybinding for all layout toggling
# -----------------------------------------------

# bindsym $mod+s layout stacking
# bindsym $mod+w layout tabbed

less noise more nice

font                            pango:monospace 8
show_marks                      no
floating_modifier               Mod1
hide_edge_borders               both
focus_follows_mouse             no
workspace_auto_back_and_forth   no

set $left  h
set $down  j
set $up    k
set $right l

set $mod Mod4
set $super bindsym Mod4
set $exec exec --no-startup-id 
set $layout 'AB=-350 AC=220 BD=252'

workspace 1 output primary

$exec i3fyra --layout $layout

# $super+Shift+r restart
$super+Shift+r                reload
$super+Return                 $exec i3-sensible-terminal
$super+Shift+q                kill
# $super+h split h
$super+v                      split v
$super+e                      layout toggle splith splitv tabbed stacking
$super+d                      $exec dmenu_run
$super+f                      fullscreen toggle
$super+a                      focus parent
$super+Shift+space            focus mode_toggle
$super+space                  $exec i3fyra --float

$super+p                      $exec i3fyra --layout $layout         

$super+$left                  $exec i3viswiz left
$super+$down                  $exec i3viswiz down
$super+$up                    $exec i3viswiz up
$super+$right                 $exec i3viswiz right

$super+Tab                    $exec i3flip next
$super+Shift+Tab              $exec i3flip perv
$super+w                      $exec i3flip --move next
$super+q                      $exec i3flip --move perv

$super+z                      $exec i3zen --workspace zen
$super+Shift+z                workspace zen

$super+Shift+$left            $exec i3Kornhe move --speed 0 left
$super+Shift+$down            $exec i3Kornhe move --speed 0 down
$super+Shift+$up              $exec i3Kornhe move --speed 0 up
$super+Shift+$right           $exec i3Kornhe move --speed 0 right

$super+Control+$left          $exec i3Kornhe size --speed 30 left
$super+Control+$down          $exec i3Kornhe size --speed 30 down
$super+Control+$up            $exec i3Kornhe size --speed 30 up
$super+Control+$right         $exec i3Kornhe size --speed 30 right

mode "sizemode" {

  bindsym $left               $exec i3Kornhe --speed 30 left
  bindsym $down               $exec i3Kornhe --speed 30 down
  bindsym $up                 $exec i3Kornhe --speed 30 up
  bindsym $right              $exec i3Kornhe --speed 30 right

  bindsym Shift+$left         $exec i3Kornhe --speed 5 left
  bindsym Shift+$down         $exec i3Kornhe --speed 5 down
  bindsym Shift+$up           $exec i3Kornhe --speed 5 up
  bindsym Shift+$right        $exec i3Kornhe --speed 5 right

  $super+Control+$left        $exec i3Kornhe size left
  $super+Control+$down        $exec i3Kornhe size down
  $super+Control+$up          $exec i3Kornhe size up
  $super+Control+$right       $exec i3Kornhe size right

  bindsym m $exec i3Kornhe move --speed 0 left

  bindsym 1 $exec i3Kornhe 1
  bindsym 2 $exec i3Kornhe 2
  bindsym 3 $exec i3Kornhe 3
  bindsym 4 $exec i3Kornhe 4
  bindsym 5 $exec i3Kornhe 5
  bindsym 6 $exec i3Kornhe 6
  bindsym 7 $exec i3Kornhe 7
  bindsym 8 $exec i3Kornhe 8
  bindsym 9 $exec i3Kornhe 9

  bindsym Escape $exec i3Kornhe x
}

$super+1 workspace 1
$super+2 workspace 2
$super+3 workspace 3
$super+4 workspace 4
$super+5 workspace 5
$super+6 workspace 6
$super+7 workspace 7
$super+8 workspace 8
$super+9 workspace 9
$super+0 workspace 10

$super+Shift+1 move container to workspace 1
$super+Shift+2 move container to workspace 2
$super+Shift+3 move container to workspace 3
$super+Shift+4 move container to workspace 4
$super+Shift+5 move container to workspace 5
$super+Shift+6 move container to workspace 6
$super+Shift+7 move container to workspace 7
$super+Shift+8 move container to workspace 8
$super+Shift+9 move container to workspace 9
$super+Shift+0 move container to workspace 10

$super+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

bar {
        status_command i3status
}
Clone this wiki locally