# Configure keybinds that interact with window layout

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

# toggle fullscreen mode for the focused container (spans across all monitors)
bindsym $mod+Shift+f fullscreen toggle global

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

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

# toggle sticky
bindsym $mod+Shift+s sticky toggle

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

# move the currently focused window to the scratchpad
bindsym $mod+F11 move scratchpad

# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+F12 scratchpad show

# split orientation
bindsym $mod+h split h;exec notify-send 'tile horizontally'
bindsym $mod+v split v;exec notify-send 'tile vertically'
bindsym $mod+q split toggle;exec notify-send 'tile direction toggled'

# To prevent accidentally changing the workspace mode, those
# keybinds are hidden behind "view_mode"
bindsym $mod+Shift+m mode "view_mode"
mode "view_mode" {
    # change container layout (stacked, tabbed, toggle split)
    # Also send a notification saying the mode was changed
    bindsym $mod+s layout stacking;exec notify-send 'Stacking Mode'
    bindsym $mod+w layout tabbed;exec notify-send 'Tabbed Mode'
    # Default mode
    bindsym $mod+e layout toggle split;exec notify-send 'Split Mode'

    # exit resize mode: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

# change focus vim keybinding
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right

# change focus arrow keybinding
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window vim keybinding
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

# move focused window arrow keybinding
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# Resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize"
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 5 px or 5 ppt
    bindsym k resize grow height 5 px or 5 ppt
    bindsym l resize shrink height 5 px or 5 ppt
    bindsym semicolon resize grow width 5 px or 5 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

    # exit resize mode: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

# End layout keybinds
