Skip to content

Instantly share code, notes, and snippets.

@kaimi
Last active January 8, 2017 02:51
Show Gist options
  • Save kaimi/5450979 to your computer and use it in GitHub Desktop.
Save kaimi/5450979 to your computer and use it in GitHub Desktop.
my i3 wm files (~/.i3)
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
set $alt Mod1
set $ctrl Control
set $shft Shift
set $mod4 Mod3
set $super Mod4
set $i3m Mod4
# font for window titles. ISO 10646 = Unicode
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
font pango:Monospace 8
# use Mouse+$i3m to drag floating windows to their wanted position
floating_modifier $alt
# start a terminal
bindsym $i3m+Return exec terminator
bindsym $super+s exec terminator
# kill focused window
bindsym $i3m+Shift+q kill
bindsym $alt+F4 kill
# start dmenu (a program launcher)
bindsym $i3m+r exec dmenu_run
# change focus
#bindsym $i3m+j focus left
#bindsym $i3m+k focus down
#bindsym $i3m+l focus up
#bindsym $i3m+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $i3m+Left focus left
bindsym $i3m+Down focus down
bindsym $i3m+Up focus up
bindsym $i3m+Right focus right
bindsym $i3m+$mod4+i focus left
bindsym $i3m+$mod4+a focus down
bindsym $i3m+$mod4+l focus up
bindsym $i3m+$mod4+e focus right
# move focused window
bindsym $i3m+Shift+j move left
bindsym $i3m+Shift+k move down
bindsym $i3m+Shift+l move up
bindsym $i3m+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $i3m+Shift+Left move left
bindsym $i3m+Shift+Down move down
bindsym $i3m+Shift+Up move up
bindsym $i3m+Shift+Right move right
bindsym $i3m+Shift+$mod4+i move left
bindsym $i3m+Shift+$mod4+a move down
bindsym $i3m+Shift+$mod4+l move up
bindsym $i3m+Shift+$mod4+e move right
# split in horizontal orientation
bindsym $i3m+h split h
# split in vertical orientation
bindsym $i3m+v split v
# enter fullscreen mode for the focused container
bindsym $i3m+f fullscreen
bindsym $i3m+Shift+f fullscreen global
# change container layout (stacked, tabbed, default)
bindsym $i3m+$shft+s layout stacking
bindsym $i3m+$shft+w layout tabbed
bindsym $i3m+$shft+e layout default
# toggle tiling / floating
bindsym $i3m+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $i3m+space focus mode_toggle
# focus the parent container
bindsym $i3m+a focus parent
# focus the child container
#bindsym $i3m+d focus child
# reload the configuration file
# bindsym $i3m+Shift+c reload
bindsym $i3m+Shift+c exec ~/.i3/reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $i3m+Shift+r exec ~/.i3/restart
# exit i3 (logs you out of your X session)
#bindsym $i3m+Shift+e exit
bindsym $ctrl+$alt+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
# 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 $i3m+r mode "resize"
bindsym $ctrl+$alt+Left workspace prev
bindsym $ctrl+$alt+Right workspace next
bindsym $ctrl+$shft+$alt+Left move container to workspace prev
bindsym $ctrl+$shft+$alt+Right move container to workspace next
bindsym $super+t [class="(?i)tilda"] focus
bindsym $super+i [class="(?i)terminator" title="IRC"] focus
bindsym $super+e exec thunar
bindsym $super+l exec xflock4
bindsym $super+Shift+v exec pavucontrol
bindsym $super+Shift+b exec gnome-control-center
bindsym F1 exec xfce4-terminal --drop-down -x screen -AURS console
# switch to workspace
bindsym $i3m+1 workspace "1:fg"
bindsym $i3m+2 workspace "2:bg"
bindsym $i3m+3 workspace number 3
bindsym $i3m+4 workspace number 4
bindsym $i3m+5 workspace number 5
bindsym $i3m+6 workspace number 6
bindsym $i3m+7 workspace number 7
bindsym $i3m+8 workspace number 8
bindsym $i3m+9 workspace number 9
bindsym $i3m+0 workspace number 10
# move focused container to workspace
bindsym $i3m+Shift+1 move container to workspace "1:fg"; workspace number 1
bindsym $i3m+Shift+2 move container to workspace "2:bg"; workspace number 2
bindsym $i3m+Shift+3 move container to workspace number 3; workspace number 3
bindsym $i3m+Shift+4 move container to workspace number 4; workspace number 4
bindsym $i3m+Shift+5 move container to workspace number 5; workspace number 5
bindsym $i3m+Shift+6 move container to workspace number 6; workspace number 6
bindsym $i3m+Shift+7 move container to workspace number 7; workspace number 7
bindsym $i3m+Shift+8 move container to workspace number 8; workspace number 8
bindsym $i3m+Shift+9 move container to workspace number 9; workspace number 9
bindsym $i3m+Shift+0 move container to workspace number 10; workspace number 10
focus_follows_mouse no
workspace_auto_back_and_forth yes
for_window [class="(?i)gnome-control-center"] floating enable
for_window [class="(?i)notif"] floating enable
for_window [class="(?i)notif"] border none
for_window [class="(?i)tilda"] floating enable
for_window [class="(?i)tilda"] border none
for_window [class="(?i)xfce4-terminal"] floating enable
for_window [class="(?i)xfce4-terminal"] border none
for_window [class="(?i)virt-manager"] floating enable
for_window [class="(?i)pavucontrol"] floating enable
for_window [class="(?i)gnome-abrt"] floating enable
for_window [class="(?i)setroubleshoot"] floating enable
for_window [class="(?i)linphone"] floating enable
for_window [class="(?i)sonata"] floating enable
for_window [class="(?i)bluetooth-wizard"] floating enable
for_window [class="(?i)system-config-*"] floating enable
for_window [title="(?i)File Operation Progress"] floating enable
for_window [title="(?i)Openshot Preferences"] floating enable
for_window [title="(?i)Upload Video"] floating enable
#for_window [title="(?i)Battle.net"] floating enable
#assign [class="(?i)Firefox"] 4:browser
assign [class="(?i)xfdesktop"] 11:desk
exec --no-startup-id xsetroot -solid "#c1c1c1"
# i3 local config file
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
position top
tray_output primary
#output HDMI1
}
workspace "1:fg" output HDMI2
workspace "2:bg" output HDMI2
workspace "3:mail" output HDMI3
workspace "4:browser" output HDMI2
workspace "5:chat" output LVDS1
workspace "11:desk" output HDMI3
assign [class="(?i)Thunderbird"] 3:mail
assign [class="(?i)terminator" title="IRC"] 5:chat
exec_always --no-startup-id vgareset
#!/usr/bin/env bash
cat ~/.i3/config.common > ~/.i3/config
cat ~/.i3/config.local >> ~/.i3/config
i3-msg reload
#!/usr/bin/env bash
cat ~/.i3/config.common > ~/.i3/config
cat ~/.i3/config.local >> ~/.i3/config
i3-msg restart
#!/usr/bin/env bash
hdmi2="$(cat /sys/class/drm/card0-HDMI-A-2/status)"
hdmi3="$(cat /sys/class/drm/card0-HDMI-A-3/status)"
vga="$(cat /sys/class/drm/card0-VGA-1/status)"
if [ "${hdmi2}" = connected -a "${hdmi3}" = connected ]; then
xrandr --output LVDS1 --auto --pos 0x600 --output HDMI3 --auto --pos 3286x0 --output HDMI2 --auto --pos 1366x0 --primary
elif [ "${vga}" = connected ]; then
xrandr --output LVDS1 --auto --primary --output VGA1 --auto --right-of LVDS1
else
xrandr --output LVDS1 --auto --primary --output VGA1 --off --output HDMI2 --off --output HDMI3 --off
fi
@kaimi
Copy link
Author

kaimi commented Apr 24, 2013

vgareset sits in my $PATH. If you put it in ~/.i3, you have to change the corresponding exec_always line in config.local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment