# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4
floating_modifier $mod

font pango:Noto Sans 9

# kill focused window
bindsym $mod+apostrophe kill
bindsym Mod1+F4 kill

# change window focus
bindsym $mod+d focus left
bindsym $mod+n focus right
bindsym $mod+t focus up
bindsym $mod+h focus down

# move focused window
bindsym $mod+Shift+d move left
bindsym $mod+Shift+n move down
bindsym $mod+Shift+t move up
bindsym $mod+Shift+h move right

# split in horizontal orientation
bindsym $mod+m split h
bindsym $mod+w split v

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

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+p layout stacking
bindsym $mod+comma layout tabbed
bindsym $mod+period layout toggle split

# toggle tiling / floating
bindsym $mod+u floating toggle
bindsym $mod+e sticky toggle

# focus the parent container
bindsym $mod+a focus parent
bindsym $mod+o focus child

#  Screen configs  #
set    $tl  "DP-0.2.1"
set    $tr  "DP-0.2.2.1"
set    $bl  "DP-0.1"
set    $br  "DVI-D-0"

# Workspace -> Screen
workspace 1 output $bl
workspace 2 output $br
workspace 3 output $tl
workspace 4 output $tr
workspace 5 output $bl
workspace 6 output $br
workspace 7 output $tl
workspace 8 output $tr

# 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 workspaces across screens
bindsym $mod+Mod1+d move workspace to output left
bindsym $mod+Mod1+n move workspace to output right
bindsym $mod+Mod1+t move workspace to output up
bindsym $mod+Mod1+h move workspace to output down

# 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

# opens logout/shutdown menu
bindsym $mod+Shift+Escape exec --no-startup-id ~/.config/i3/powermenu.sh

set $bg-color            #2f343f
set $inactive-bg-color   #2f343f
set $text-color          #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color     #E53935

# window colors
#                       border              background         text                 indicator
client.focused          $bg-color           $bg-color          $text-color          $bg-color
client.unfocused        $inactive-bg-color  $inactive-bg-color $inactive-text-color $bg-color
client.focused_inactive $inactive-bg-color  $inactive-bg-color $inactive-text-color $bg-color
client.urgent           $urgent-bg-color    $urgent-bg-color   $text-color          $bg-color

bar {
    status_command i3blocks -c ~/.config/i3/blocks/config

    workspace_buttons yes
    strip_workspace_numbers yes
    tray_output primary
    tray_padding 2
    height 20

    #output $br
    position top

    colors {
        separator #757575
        background #2f343f
        #                  border             background         text
        focused_workspace  $bg-color          $bg-color          $text-color
        inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
        urgent_workspace   $urgent-bg-color   $urgent-bg-color   $text-color
    }
}

# Window rules
for_window [class="Pavucontrol"] floating enable
for_window [class="Blueman-manager"] floating enable
for_window [window_role="floating-term"] floating enable
for_window [window_role="i3blocks-update-term"] floating enable
for_window [window_role="i3blocks-clock-term"] floating enable

new_window pixel 5
new_float none

gaps inner 7
gaps outer 2
#smart_gaps on

focus_follows_mouse yes

# keybindings
bindsym $mod+Shift+j reload
bindsym $mod+Shift+p restart
bindsym $mod+c       exec chromium
bindsym $mod+v       exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\"
bindsym $mod+Ctrl+v  exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\"
bindsym Mod1+Tab     exec ~/.config/i3/alt-tab.sh
bindsym $mod+Return  exec i3-sensible-terminal
bindsym $mod+Ctrl+Return  exec i3-sensible-terminal -r floating-term  --geometry 96x30
bindsym $mod+Shift+Return  exec i3-sensible-terminal -d "`xcwd`"
bindsym $mod+Ctrl+Shift+Return  exec i3-sensible-terminal -r floating-term  --geometry 96x30 -d "`xcwd`"
bindsym $mod+l       exec ~/.config/i3/lock.sh
# -fg "#CCD3DAE3" -bg "#CC383C4A" -hlbg "#CC5294E2" 
bindsym $mod+space   exec rofi -show run -sidebar-mode -terminal i3-sensible-terminal 
bindsym --release Print        exec imgur-screenshot
bindsym --release $mod+Print   exec imgur-screenshot -f
bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
bindsym $mod+numbersign exec notify-send "$(xclip -o | gpg --decrypt 2>&1)"
bindsym $mod+g       exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\""

# Media player controls
bindsym XF86AudioPlay  exec --no-startup-id mpc toggle
bindsym XF86AudioPause exec --no-startup-id mpc pause
bindsym XF86AudioStop  exec --no-startup-id mpc stop
bindsym XF86AudioNext  exec --no-startup-id mpc next
bindsym XF86AudioPrev  exec --no-startup-id mpc previous
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2% && pkill -RTMIN+10 i3blocks
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2% && pkill -RTMIN+10 i3blocks
bindsym XF86AudioMute        exec --no-startup-id pactl set-sink-mute   @DEFAULT_SINK@ toggle && pkill -RTMIN+10 i3blocks
exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; done"

# app launch shortcuts
exec --no-startup-id ~/.fehbg
exec --no-startup-id ~/.config/i3/disable-standby-fs.py
exec xautolock -time 5 -locker ~/.config/i3/lock.sh

# startup programs
exec --no-startup-id pulseaudio
exec --no-startup-id dropbox
exec --no-startup-id insync start
exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet
exec --no-startup-id redshift
exec --no-startup-id xbindkeys
exec --no-startup-id compton -b --config ~/.config/compton.conf
exec --no-startup-id chromium --no-startup-window

exec i3-msg 'workspace 2; exec i3-sensible-terminal'
exec i3-msg 'workspace 3; exec sleep 2 && chromium'

# vim:ft=i3
