# 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 some time, 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

for_window [instance="yad"] floating enable

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 10
font pango:DejaVu Sans Mono 9


# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# 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, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

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

# start a terminal
bindsym $mod+Return exec --no-startup-id i3-sensible-terminal

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

#rofi
bindsym $mod+Shift+d exec --no-startup-id rofi -show drun -sidebar-mode 

# 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; exec --no-startup-id notify-send --expire-time=1000 'tile horizontally'

# split in vertical orientation
bindsym $mod+v split v; exec --no-startup-id notify-send --expire-time=1000 'tile vertically'

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle; exec --no-startup-id notify-send --expire-time=1000 'fullscreen toggle'

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking; exec --no-startup-id notify-send --expire-time=1000 'container layout: stacked'
bindsym $mod+w layout tabbed; exec --no-startup-id notify-send --expire-time=1000 'container layout: tabbed'
bindsym $mod+e layout toggle split; exec --no-startup-id notify-send --expire-time=1000 'container layout: toggle split'

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle; exec --no-startup-id notify-send --expire-time=1000 'floating toggle'

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle; exec --no-startup-id notify-send --expire-time=1000 'focus mode toggle'

# focus the parent container
bindsym $mod+a focus parent; exec --no-startup-id notify-send --expire-time=1000 'parent container focused'

# focus the child container
bindsym $mod+d focus child; exec --no-startup-id notify-send --expire-time=1000 'child container focused'

# move focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad; exec --no-startup-id notify-send --expire-time=1000 'focused window moved to scratchpad'

# Show the next scratchpad window or hide the focused scratchpad window.
bindsym $mod+minus scratchpad show; exec --no-startup-id notify-send --expire-time=1000 'cycle through scratchpad windows'

#navigate workspaces next / previous
bindsym $mod+Ctrl+Right workspace next
bindsym $mod+Ctrl+Left workspace prev

# Workspace names
set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
set $ws9 9

# switch to workspace
bindsym $mod+1 workspace $ws1; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws1'
bindsym $mod+2 workspace $ws2; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws2'
bindsym $mod+3 workspace $ws3; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws3'
bindsym $mod+4 workspace $ws4; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws4'
bindsym $mod+5 workspace $ws5; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws5'
bindsym $mod+6 workspace $ws6; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws6'
bindsym $mod+7 workspace $ws7; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws7'
bindsym $mod+8 workspace $ws8; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws8'
bindsym $mod+9 workspace $ws9; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws9'

# move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws1'
bindsym $mod+Ctrl+2 move container to workspace $ws2; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws2'
bindsym $mod+Ctrl+3 move container to workspace $ws3; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws3'
bindsym $mod+Ctrl+4 move container to workspace $ws4; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws4'
bindsym $mod+Ctrl+5 move container to workspace $ws5; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws5'
bindsym $mod+Ctrl+6 move container to workspace $ws6; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws6'
bindsym $mod+Ctrl+7 move container to workspace $ws7; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws7'
bindsym $mod+Ctrl+8 move container to workspace $ws8; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws8'
bindsym $mod+Ctrl+9 move container to workspace $ws9; exec --no-startup-id notify-send --expire-time=1000 'container moved to workspace $ws9'

# Move to workspace with focused container
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws1'
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws2'
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws3'
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws4'
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws5'
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws6'
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws7'
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws8'
bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9; exec --no-startup-id notify-send --expire-time=1000 'workspace $ws9'

# reload the configuration file
bindsym $mod+Shift+c reload; exec --no-startup-id notify-send --expire-time=1000 "configuration file reloaded"
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart

# 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"; exec --no-startup-id notify-send --expire-time=1000 "Resize mode"

default_border normal 0
hide_edge_borders both
focus_follows_mouse no
popup_during_fullscreen smart

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

#set $bg-color 	          #091C29
#set $inactive-bg-color   #091C29
#set $text-color          #f3f4f5
#set $inactive-text-color #676E7D
#set $urgent-bg-color     #E53935

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


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


# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3blocks
        colors {
		background $bg-color
	    	separator #757575
		#                  border             bg	         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
        }
	mode dock
	font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 	font pango:DejaVu Sans Mono 9
	tray_padding 1
	separator_symbol "|"
}

# autostart
exec --no-startup-id pnmixer &
exec --no-startup-id nm-applet &
exec --no-startup-id xfce4-power-manager &
exec --no-startup-id nitrogen --restore &
exec --no-startup-id /usr/bin/sparky-polkit &
exec --no-startup-id xautolock -time 10 -locker 'i3lock-fancy -g -p' & ## this command activates screenlock after 10 minutes of inactivity ##
exec --no-startup-id xss-lock -- i3lock-fancy -g -p & ## this command activates screenlock when system resumes from sleep/hibernation ##
exec_always --no-startup-id conky --config=/opt/conky/conky-sparky-i3.conf &
exec --no-startup-id thunar-daemon &
exec --no-startup-id xdg-user-dirs-update &

#quit
bindsym $mod+Shift+e exec --no-startup-id /usr/share/i3blocks/shutdown_menu_sparky

# monitor settings
bindsym $mod+Ctrl+l exec --no-startup-id lxrandr
# file manager
bindsym $mod+Ctrl+f exec --no-startup-id sparky-fileopen
# web browser
bindsym $mod+Ctrl+w exec --no-startup-id x-www-browser
# wallpaper
bindsym $mod+Ctrl+n exec --no-startup-id nitrogen
# synaptic
bindsym $mod+Ctrl+y exec --no-startup-id synaptic-pkexec
# firewall
bindsym $mod+Ctrl+u exec --no-startup-id gufw
# printer
bindsym $mod+Ctrl+p exec --no-startup-id system-config-printer
# lxtask
bindsym $mod+Ctrl+x exec --no-startup-id lxtask
# gscreenshot
bindsym $mod+Ctrl+s exec --no-startup-id gscreenshot

#CAPS/NUM
bindsym --release Caps_Lock 	exec --no-startup-id "pkill -SIGRTMIN+11 i3blocks; notify-send --expire-time=1000 'Capslock toggle'"
bindsym --release Num_Lock  	exec --no-startup-id "pkill -SIGRTMIN+11 i3blocks; notify-send --expire-time=1000 'Numlock toggle'"

#XF86 events
#Change screen brightness
#bindsym XF86MonBrightnessDown	exec --no-startup-id "xbacklight -dec 10; notify-send --expire-time=1000 'Brightness down'"
#bindsym XF86MonBrightnessUp 	exec --no-startup-id "xbacklight -inc 10; notify-send --expire-time=1000 'Brightness up'"

# change volume or toggle mute
#bindsym XF86AudioRaiseVolume 	exec --no-startup-id "amixer -q -D default sset Master 5%+; pkill -RTMIN+1 i3blocks; notify-send --expire-time=1000 'Volume up'"
#bindsym XF86AudioLowerVolume 	exec --no-startup-id "amixer -q -D default sset Master 5%-; pkill -RTMIN+1 i3blocks; notify-send --expire-time=1000 'Volume down'"
#bindsym XF86AudioMute 		exec --no-startup-id "amixer -q -D default sset Master toggle; pkill -RTMIN+1 i3blocks; notify-send --expire-time=1000 'Mute toggle'"
