# 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

# font for window titles. ISO 10646 = Unicode
#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
font -misc-fixed-*-*-semicondensed-*-13-*-*-*-*-*-*-*
#font pango:Misc Fixed:style=SemiCondensed:pixelsize=13

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

default_orientation auto
workspace_layout stacking
hide_edge_borders both
force_focus_wrapping no
workspace_auto_back_and_forth yes
show_marks yes

for_window [all] title_format "%title - «%instance»"
for_window [all] title_window_icon padding 3

for_window [title="Media viewer" class="TelegramDesktop"] floating enable, fullscreen enable

set_from_resource $f_bord i3wm.focused_border #4c7899
set_from_resource $f_back i3wm.focused_background #285577
set_from_resource $f_text i3wm.focused_text #ffffff

# class                 border  backgr. text    indicator child_border
client.focused          $f_bord $f_back $f_text #2e9ef4   #666666
client.focused_inactive #333333 #5f676a #ffffff #484e50   #333333
client.unfocused        #333333 #222222 #888888 #292d2e   #222222
client.urgent           #2f343a #900000 #ffffff #900000   #900000
client.placeholder      #000000 #0c0c0c #ffffff #000000   #0c0c0c

client.background       #ffffff

# start a terminal
#bindsym $mod+Return exec /home/ccx/bin/zenv urxvt-launch
bindsym $mod+Return exec urxvt
#bindsym $mod+Shift+Return exec zenv urxvtc -e su -

#bindsym $mod+b exec zenv urxvt-launch w3m -B
#bindsym $mod+i exec zenv urxvt-launch ipython
#bindsym $mod+Shift+O exec xscreensaver-command -lock
bindsym $mod+Shift+O exec powerbox-plumb lock
bindsym $mod+grave exec powerbox-menu
#bindsym $mod+Shift+G exec wswitch
bindsym $mod+Control+t exec c.exec.user mpd mpc toggle
bindsym $mod+Control+Up exec c.exec.user sndiod master-set "2dB+"
bindsym $mod+Control+Down exec c.exec.user sndiod master-set "2dB-"
bindsym XF86AudioMute exec c.exec.user sndiod master-toggle
bindsym $mod+i exec shiftinsert
bindsym $mod+v exec ctrlv

# bindsym $mod+space mark --toggle M
# bindsym $mod+Shift+space move window to mark M
bindsym $mod+Control+space move scratchpad
bindsym $mod+Tab scratchpad show

bindsym $mod+Control+1 mark --toggle 1
bindsym $mod+Control+2 mark --toggle 2
bindsym $mod+Control+3 mark --toggle 3
bindsym $mod+Control+4 mark --toggle 4
bindsym $mod+Control+5 mark --toggle 5
bindsym $mod+Control+6 mark --toggle 6
bindsym $mod+Control+7 mark --toggle 7
bindsym $mod+Control+8 mark --toggle 8
bindsym $mod+Control+9 mark --toggle 9
bindsym $mod+Control+0 mark --toggle 0

bindsym $mod+Control+Shift+exclam move window to mark 1
bindsym $mod+Control+Shift+at move window to mark 2
bindsym $mod+Control+Shift+numbersign move window to mark 3
bindsym $mod+Control+Shift+dollar move window to mark 4
bindsym $mod+Control+Shift+percent move window to mark 5
bindsym $mod+Control+Shift+asciicircum move window to mark 6
bindsym $mod+Control+Shift+ampersand move window to mark 7
bindsym $mod+Control+Shift+asterisk move window to mark 8
bindsym $mod+Control+Shift+parenleft move window to mark 9
bindsym $mod+Control+Shift+parenright move window to mark 0

# kill focused window
bindsym $mod+Shift+C kill

# start dmenu (a program launcher)
bindsym $mod+p exec dmenu_run
#bindsym $mod+y exec zenv dmenu_run_xpra
bindsym $mod+y exec xterm

# password manager
bindsym $mod+Shift+p exec xpass

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l 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+H move left
bindsym $mod+Shift+J move down
bindsym $mod+Shift+K move up
bindsym $mod+Shift+L 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

# move workspaces around outputs
bindsym $mod+Control+h move workspace to output left
bindsym $mod+Control+j move workspace to output down
bindsym $mod+Control+k move workspace to output up
bindsym $mod+Control+l move workspace to output right

# split in horizontal orientation
bindsym $mod+Shift+quotedbl split v

# split in vertical orientation
bindsym $mod+apostrophe split h

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen

# change container layout (stacked, tabbed, default)
#bindsym $mod+g layout stacking
#bindsym $mod+t layout tabbed
#bindsym $mod+z layout default

# zenv unnecessary here, remove after I fix dmenu font in env
bindsym $mod+g exec goa

# 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+semicolon focus parent
bindsym $mod+Shift+colon focus child

# focus the child container
#bindcode $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
bindsym $mod+q workspace 11:Q
bindsym $mod+w workspace 12:W
bindsym $mod+e workspace 13:E
bindsym $mod+a workspace 14:A
bindsym $mod+s workspace 15:S
bindsym $mod+d workspace 16:D

# move focused container to workspace
bindsym $mod+Shift+exclam move workspace 1
bindsym $mod+Shift+at move workspace 2
bindsym $mod+Shift+numbersign move workspace 3
bindsym $mod+Shift+dollar move workspace 4
bindsym $mod+Shift+percent move workspace 5
bindsym $mod+Shift+asciicircum move workspace 6
bindsym $mod+Shift+ampersand move workspace 7
bindsym $mod+Shift+asterisk move workspace 8
bindsym $mod+Shift+parenleft move workspace 9
bindsym $mod+Shift+parenright move workspace 10
bindsym $mod+Shift+Q move workspace 11:Q
bindsym $mod+Shift+W move workspace 12:W
bindsym $mod+Shift+E move workspace 13:E
bindsym $mod+Shift+A move workspace 14:A
bindsym $mod+Shift+S move workspace 15:S
bindsym $mod+Shift+D move workspace 16:D

#exec --no-startup-id "exec $HOME/bin/x"

# Workspace -> Output map
# Old setup was     : DVI-0 <DisplayPort-0> HDMI-0 | DVI-1
# From left to right: DVI-0 <DVI-1> HDMI-0 | DisplayPort-0
workspace 1     output DVI-1
workspace 2     output HDMI-0
workspace 3     output DVI-0
workspace 4     output HDMI-0
workspace 5     output DVI-0
workspace 6     output HDMI-0
workspace 7     output HDMI-0
workspace 8     output HDMI-0
workspace 9     output HDMI-0
workspace 10    output HDMI-0
workspace 11:Q  output DVI-0
workspace 12:W  output DVI-0
workspace 13:E  output HDMI-0
workspace 14:A  output DVI-0
workspace 15:S  output DVI-1
workspace 16:D  output DisplayPort-0

# reload the configuration file
bindsym $mod+x 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+X exit

bindsym $mod+Control+w mode "layout"

mode "layout" {
bindsym t layout tabbed ; mode "default"
bindsym s layout stacking ; mode "default"
bindsym g layout stacking ; mode "default"
bindsym d layout default ; mode "default"
bindsym v layout splith ; mode "default"
bindsym h layout splitv ; mode "default"

bindsym $mod+t splith; layout tabbed ; mode "default"
bindsym $mod+s splith; layout stacking ; mode "default"
bindsym $mod+g splith; layout stacking ; mode "default"
bindsym $mod+d splith; layout default ; mode "default"
bindsym $mod+v splith; mode "default"
bindsym $mod+h splitv; mode "default"

        # back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym space mode "default"
bindsym q mode "default"
}

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # They resize the border in the direction you pressed, e.g.
        # when pressing left, the window is resized so that it has
        # more space on its left

bindsym h resize shrink left 10 px or 5 ppt
bindsym Shift+H resize grow   left 10 px or 5 ppt

bindsym j resize shrink down 10 px or 5 ppt
bindsym Shift+J resize grow   down 10 px or 5 ppt

bindsym k resize shrink up 10 px or 5 ppt
bindsym Shift+K resize grow   up 10 px or 5 ppt

bindsym l resize shrink right 10 px or 5 ppt
bindsym Shift+L resize grow   right 10 px or 5 ppt

        # same bindings, but for the arrow keys
bindsym Left resize shrink left 10 px or 5 ppt
bindsym Shift+Left resize grow   left 10 px or 5 ppt

bindsym Down resize shrink down 10 px or 5 ppt
bindsym Shift+Down resize grow   down 10 px or 5 ppt

bindsym Up resize shrink up 10 px or 5 ppt
bindsym Shift+Up resize grow   up 10 px or 5 ppt

bindsym Right resize shrink right 10 px or 5 ppt
bindsym Shift+Right resize grow   right 10 px or 5 ppt

        # back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym space mode "default"
bindsym q mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        position top
        status_command s6-ipcclient /run/i3status.s s6-ioconnect -67
        strip_workspace_numbers yes
        colors {
                focused_workspace $f_bord $f_back $f_text
        }
}