#font pango:Fira Code 12, FontAwesome 12, FiraCode Nerd Font 12
font Unifont, 12

focus_follows_mouse no
mouse_warping none

floating_minimum_size 100 x 100
floating_maximum_size 1920 x 1080

# class                 border  bground text    indicator child_border
client.focused          #FF5555 #6272A4 #F8F8F2 #6272A4   #FF5555
client.focused_inactive #44475A #44475A #F8F8F2 #44475A   #44475A
client.unfocused        #282A36 #282A36 #BFBFBF #282A36   #282A36
client.urgent           #44475A #FF5555 #F8F8F2 #FF5555   #FF5555
client.placeholder      #282A36 #282A36 #F8F8F2 #282A36   #282A36

client.background       #F8F8F2

exec --no-startup-id    ~/.config/i3/scripts/delayedautostart.sh

for_window [class="Alacritty"] focus

for_window [all] border pixel 2

for_window [all] title_window_icon on

# set floating (nontiling)for apps needing it
for_window [class="Yad" instance="yad"] floating enable
for_window [class="com..*"] floating enable
for_window [title="floatthiswindow"] floating enable
for_window [class="Galculator" instance="galculator"] floating enable
for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
for_window [class="Xsane" instance="xsane"] floating enable
for_window [class="Pavucontrol" instance="pavucontrol"] floating enable
for_window [class="qt5ct" instance="qt5ct"] floating enable
for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable
for_window [class="Pamac-manager"] floating enable
for_window [class="Xfce4.*settings"] floating enable
for_window [title="PlayOnLinux configuration"] floating enable
for_window [title="PlayOnLinux"] floating enable

assign [instance="startKitty"]              $ws1
assign [instance="startEmacs"]              $ws2
assign [class="^[Ss]team.*"]                 $ws5
assign [class="airshipper"]                 $ws5
assign [class="^Minecraft.*"]                $ws5
assign [class="^MultiMc.*"]                  $ws5

set $mod Mod4

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

bindsym $mod+Return	exec xrdb -load ~/.config/X11/Xresources; exec terminal

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

set $ws1	"1:CMD"
set $ws2	"2:WORK"
set $ws3	"3:WWW"
set $ws4	"4:FILE"
set $ws5	"5:GAMES"
set $ws6	"6"
set $ws7	"7"
set $ws8	"8"
set $ws9	"9:CHAT"
set $ws10	"10:KEY"

# switch to workspace
bindsym $mod+1		workspace $ws1
bindsym $mod+2		workspace $ws2
bindsym $mod+3		workspace $ws3
bindsym $mod+4		workspace $ws4
bindsym $mod+5		workspace $ws5
bindsym $mod+6		workspace $ws6
bindsym $mod+7		workspace $ws7
bindsym $mod+8		workspace $ws8
bindsym $mod+9		workspace $ws9
bindsym $mod+0		workspace $ws10

# move focused container to workspace
bindsym $mod+Shift+1	move container to workspace $ws1
bindsym $mod+Shift+2	move container to workspace $ws2
bindsym $mod+Shift+3	move container to workspace $ws3
bindsym $mod+Shift+4	move container to workspace $ws4
bindsym $mod+Shift+5	move container to workspace $ws5
bindsym $mod+Shift+6	move container to workspace $ws6
bindsym $mod+Shift+7	move container to workspace $ws7
bindsym $mod+Shift+8	move container to workspace $ws8
bindsym $mod+Shift+9	move container to workspace $ws9
bindsym $mod+Shift+0	move container to workspace $ws10

bindsym Print		exec "flameshot full"
bindsym Shift+Print	exec "flameshot gui"
bindsym Control+Print	exec "flameshot screen"

bindsym $mod+h	focus left
bindsym $mod+j	focus down
bindsym $mod+k	focus up
bindsym $mod+l	focus right

bindsym $mod+Mod1+h	focus output left
bindsym $mod+Mod1+j	focus output down
bindsym $mod+Mod1+k	focus output up
bindsym $mod+Mod1+l	focus output right

bindsym $mod+Shift+h	move left
bindsym $mod+Shift+j	move down
bindsym $mod+Shift+k	move up
bindsym $mod+Shift+l	move right

bindsym $mod+Mod1+Shift+h	move output left; focus output left
bindsym $mod+Mod1+Shift+j	move output down; focus output down
bindsym $mod+Mod1+Shift+k	move output up; focus output up
bindsym $mod+Mod1+Shift+l	move output right; focus output right

bindsym $mod+Mod1+Control+h	move workspace to output left
bindsym $mod+Mod1+Control+j	move workspace to output down
bindsym $mod+Mod1+Control+k	move workspace to output up
bindsym $mod+Mod1+Control+l	move workspace to output right

# Swap workspace between screens
#bindsym Mod4+Shift+Control+j	exec ~/.config/i3/scripts/display_swap

bindsym $mod+Ctrl+h	resize shrink width 10 px or 10 ppt
bindsym $mod+Ctrl+k	resize grow height 10 px or 10 ppt
bindsym $mod+Ctrl+j	resize shrink height 10 px or 10 ppt
bindsym $mod+Ctrl+l	resize grow width 10 px or 10 ppt

bindsym $mod+Shift+s	split toggle

# Change focus between tiling / floating windows
bindsym $mod+space		focus mode_toggle

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

bindsym $mod+t	layout tabbed
bindsym $mod+v	layout toggle split
bindsym $mod+f	floating toggle
bindsym $mod+m	fullscreen

set $rofi "r - Apps | c - Calc"

bindsym $mod+r	exec dmenu_run -b

mode $rofi {

	bindsym r		exec rofi -modi drun -show drun \
							  -location 6 -m -1 -display-drun "Apps: " \
							  -show-icons; mode "default"

	bindsym c		exec rofi -modi calc -show calc \
							  -location 6 -m -1; mode "default"

	bindsym Return	mode "default"
	bindsym Escape	mode "default"
}

set $system "p - Power Off | r - Reboot | s - Suspend | h - Hibernate | \
l - Lock | R - Reload I3 | C-r - Restart I3 | L - Logout"

bindsym $mod+s	mode $system

mode $system {
	bindsym p		exec "i3-nagbar -t warning -m 'Power off?' \
							-B 'Yup' 'systemctl poweroff'"; mode "default"

	bindsym r		exec "i3-nagbar -t warning -m 'Restart?' \
							-B 'Yup' 'systemctl reboot'"; mode "default"

	bindsym s		exec systemctl suspend; mode "default"
	bindsym h		exec systemctl hibernate; mode "default"
	bindsym l		exec i3lock -c000000; mode "default"

	bindsym Shift+r	reload; mode "default"
	bindsym Ctrl+r		restart; mode "default"
	bindsym Shift+l	exit; mode "default"

	bindsym Return	mode "default"
	bindsym Escape	mode "default"
}

bar {
	#font pango:Fira Code 11, FontAwesome 11
	font Unifont 11

	tray_output primary
	tray_padding 0

	status_command i3blocks -c ~/.config/i3/blocks.conf
	position bottom

	strip_workspace_numbers yes

	colors {
		background	#2E303F
		statusline	#F8F8F2
		separator	#44475A

		focused_workspace	#44475A #44475A #F8F8F2
		active_workspace	#282A36 #44475A #F8F8F2
		inactive_workspace	#282A36 #282A36 #BFBFBF
		urgent_workspace	#FF5555 #FF5555 #F8F8F2
		binding_mode		#FF5555 #FF5555 #F8F8F2
	}
}
