Skip to content

Instantly share code, notes, and snippets.

@Ferdi265
Created October 14, 2015 05:32
Show Gist options
  • Save Ferdi265/6c12556edeffc9f00bc0 to your computer and use it in GitHub Desktop.
Save Ferdi265/6c12556edeffc9f00bc0 to your computer and use it in GitHub Desktop.
i3 config
# ~/.config/i3/config
# startup scripts
exec --no-startup-id ~/.config/i3/rc
# use super as mod
set $mod Mod4
# font (window titles, never seen)
font pango:DejaVu Sans 10
# gaps
new_window pixel
new_float pixel
gaps outer 10
gaps inner 10
# Use Mouse+$mod to drag floating windows
floating_modifier $mod
# start keys
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+e exec thunar
# scrot
bindsym Print exec --no-startup-id "scrot ~/Pictures/$(date +%F-%T).png; notify-send Screenshot 'Image saved to ~/Pictures/'$(date +%F-%T).png"
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id dmenu_run
# focus settings
focus_follows_mouse yes
focus_on_window_activation smart
# change focus
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+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split
bindsym $mod+h split h
bindsym $mod+v split v
# enter fullscreen
bindsym $mod+f fullscreen toggle
# change container layout
# conflicts with system mode
#bindsym $mod+s layout stacking
#bindsym $mod+t layout tabbed
#bindsym $mod+p layout toggle split
# 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
#bindsym $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# system commands like reloading configs or hibernate
mode "system" {
# system power
bindsym p exec --no-startup-id "i3mode default; systemctl poweroff"
bindsym r exec --no-startup-id "i3mode default; systemctl reboot"
bindsym s exec --no-startup-id "i3mode default; xlmode now; systemctl suspend"
bindsym h exec --no-startup-id "i3mode default; xlmode now; systemctl hibernate"
# session lock / logout
bindsym l exec --no-startup-id "i3mode default; xlmode now"
bindsym Shift+l exec --no-startup-id "i3mode default; xlmode toggle"
bindsym e exec --no-startup-id "i3mode default; i3-msg exit"
# i3 config reload / in-place upgrade
bindsym c exec --no-startup-id "i3mode default; i3-msg reload"
bindsym u exec --no-startup-id "i3mode default; i3-msg restart"
# exit mode
bindsym Return exec --no-startup-id "i3mode default"
bindsym Escape exec --no-startup-id "i3mode default"
}
# conflicts with stacking layout
bindsym $mod+s exec --no-startup-id "i3mode system"
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym Left resize shrink width 5 px or 5 ppt
bindsym Down resize grow height 5 px or 5 ppt
bindsym Up resize shrink height 5 px or 5 ppt
bindsym Right resize grow width 5 px or 5 ppt
# exit mode
bindsym Return exec --no-startup-id "i3mode default"
bindsym Escape exec --no-startup-id "i3mode default"
}
bindsym $mod+r exec --no-startup-id "i3mode resize"
# colors
client.focused #96a900 #859900 #fdf6e3 #859900
client.focused_inactive #369be2 #269be2 #eee8d5 #6c71c4
client.unfocused #369be2 #269be2 #93a1a1 #586e75
client.urgent #cb4b16 #dc322f #fdf6e3 #dc322f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment