Skip to content

Instantly share code, notes, and snippets.

@simonhayward
Last active July 1, 2019 15:38
Show Gist options
  • Save simonhayward/11316105 to your computer and use it in GitHub Desktop.
Save simonhayward/11316105 to your computer and use it in GitHub Desktop.
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# screens
set $topscreen HDMI1
set $laptopscreen LVDS1
# Workspace names
set $ws1 1 firefox
set $ws2 2 chrome
set $ws3 3 term
set $ws4 4 keepassx
set $ws5 5 mail
set $ws6 6 term
set $ws7 7 term
set $ws8 8 term
set $ws9 9
set $ws10 10
set $ws11 11
set $ws12 12
set $ws13 13
set $ws14 14
set $ws15 15
set $ws16 16
set $ws17 17
set $ws18 18
set $ws19 19
set $ws20 20
# start automatically
exec --no-startup-id i3-msg "workspace $ws1; exec /usr/bin/firefox"
exec --no-startup-id i3-msg "workspace $ws2; exec /usr/bin/google-chrome"
exec --no-startup-id i3-msg "workspace $ws3; exec /usr/bin/gnome-terminal"
exec --no-startup-id i3-msg "workspace $ws1; exec /usr/bin/thunderbird"
# Assign to workspace
assign [class="Firefox"] $ws1
assign [class="Google-chrome"] $ws2
assign [class="gnome-terminal"] $ws2
assign [class="keepassx"] $ws4
assign [class="Thunderbird"] $ws5
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, if you need a lot of unicode glyphs or
# right-to-left text rendering, you should instead use pango for rendering and
# chose an xft font, such as:
# font xft:DejaVu Sans Mono 10
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
#bindsym $mod+Return exec st
# 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+semicolon 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, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e 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
#bindcode $mod+d focus child
# switch to workspace
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"
# workspaces from 11-20
bindsym $mod+Control+1 workspace number "$ws11"
bindsym $mod+Control+2 workspace number "$ws12"
bindsym $mod+Control+3 workspace number "$ws13"
bindsym $mod+Control+4 workspace number "$ws14"
bindsym $mod+Control+5 workspace number "$ws15"
bindsym $mod+Control+6 workspace number "$ws16"
bindsym $mod+Control+7 workspace number "$ws17"
bindsym $mod+Control+8 workspace number "$ws18"
bindsym $mod+Control+9 workspace number "$ws19"
bindsym $mod+Control+0 workspace number "$ws20"
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+Shift+Control+1 move container to workspace number 11
bindsym $mod+Shift+Control+2 move container to workspace number 12
bindsym $mod+Shift+Control+3 move container to workspace number 13
bindsym $mod+Shift+Control+4 move container to workspace number 14
bindsym $mod+Shift+Control+5 move container to workspace number 15
bindsym $mod+Shift+Control+6 move container to workspace number 16
bindsym $mod+Shift+Control+7 move container to workspace number 17
bindsym $mod+Shift+Control+8 move container to workspace number 18
bindsym $mod+Shift+Control+9 move container to workspace number 19
bindsym $mod+Shift+Control+0 move container to workspace number 20
# 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 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'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 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 {
status_command ~/bin/,i3-custom-status.sh
tray_output primary
}
# System suspend
bindsym $mod+Shift+s exec i3lock -i ~/Pictures/bg.png && sudo pm-suspend
# Lock screen
bindsym $mod+F12 exec i3lock -i ~/Pictures/bg.png
# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the first scratchpad window
bindsym $mod+minus scratchpad show
# dropbox
exec --no-startup-id ~/.dropbox-dist/dropboxd
# DPMS blank screen after 10 mins
exec --no-startup-id xset dpms 600
# Put workspaces on external monitor
workspace "$ws1" output $topscreen
workspace "$ws2" output $topscreen
workspace "$ws3" output $topscreen
workspace "$ws4" output $topscreen
workspace "$ws5" output $topscreen
workspace "$ws6" output $topscreen
workspace "$ws7" output $topscreen
workspace "$ws8" output $topscreen
workspace "$ws9" output $topscreen
workspace "$ws10" output $topscreen
workspace "$ws11" output $topscreen
workspace "$ws12" output $topscreen
workspace "$ws13" output $topscreen
workspace "$ws14" output $topscreen
workspace "$ws15" output $topscreen
workspace "$ws16" output $topscreen
workspace "$ws17" output $topscreen
workspace "$ws18" output $topscreen
workspace "$ws19" output $laptopscreen
workspace "$ws20" output $laptopscreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment