# start user containers
exec_always sudo /usr/local/bin/start-user-containers xfce4

# start foot terminal emulator "server"
exec foot -s

# disable swaybg
swaybg_command -

xwayland disable

focus_follows_mouse no

### Variables

# Logo key. Use Mod1 for Alt.
set $mod Mod4
# terminal emulator
set $term footclient
# application launcher
set $menu bemenu-run -l 20 -W 0.2 -B 2 -p "run:"

### Input configuration

input "type:keyboard" {
    xkb_model "pc105"
    xkb_layout "us,ua,ro,ru"
    xkb_options "grp:alt_shift_toggle"
    repeat_delay 250
    repeat_rate 30
}

### Key bindings

# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal

mode "resize" {
    # Resising container mode
    bindsym Left resize shrink width 10px
    bindsym Down resize grow height 10px
    bindsym Up resize shrink height 10px
    bindsym Right resize grow width 10px

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym --to-code {
    # Exit sway (logs you out of your Wayland session)
    Ctrl+Shift+Backspace exit

    # Reload the configuration file
    $mod+Shift+c reload

    # Kill focused window
    $mod+Shift+q kill

    # Start launcher
    $mod+d exec $menu

    # Start a terminal
    $mod+Return exec $term

    # Split current container horizontally/vertically
    $mod+h splith
    $mod+v splitv

    # Resize container
    $mod+r mode "resize"

    # Make the current focus fullscreen
    $mod+f fullscreen

    # Toggle/swap focus between tiling and floating mode
    $mod+Shift+space floating toggle
    $mod+space focus mode_toggle

    # Move focus to the parent container
    $mod+a focus parent

    # Move the currently focused window to the scratchpad
    $mod+Shift+minus move scratchpad

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

    # Switch the current container between different layout styles
    $mod+s layout stacking
    $mod+w layout tabbed
    $mod+e layout toggle split

    # Move your focus around
    $mod+Left focus left
    $mod+Down focus down
    $mod+Up focus up
    $mod+Right focus right

    # Move the focused window with the same, but add Shift
    $mod+Shift+Left move left
    $mod+Shift+Down move down
    $mod+Shift+Up move up
    $mod+Shift+Right move right

    # Switch to workspace
    $mod+1 workspace number 1
    $mod+2 workspace number 2
    $mod+3 workspace number 3
    $mod+4 workspace number 4
    $mod+5 workspace number 5
    $mod+6 workspace number 6
    $mod+7 workspace number 7
    $mod+8 workspace number 8
    $mod+9 workspace number 9
    $mod+0 workspace number 10

    # Move focused container to workspace
    $mod+Shift+1 move container to workspace number 1
    $mod+Shift+2 move container to workspace number 2
    $mod+Shift+3 move container to workspace number 3
    $mod+Shift+4 move container to workspace number 4
    $mod+Shift+5 move container to workspace number 5
    $mod+Shift+6 move container to workspace number 6
    $mod+Shift+7 move container to workspace number 7
    $mod+Shift+8 move container to workspace number 8
    $mod+Shift+9 move container to workspace number 9
    $mod+Shift+0 move container to workspace number 10
    # Note: workspaces can have any name you want, not just numbers.
    # We just use 1-10 as the default.
}

# Status Bar
bar {
    position top
    swaybar_command waybar
}

# disable titlebar for windows -- begin
default_border none
default_floating_border none
font pango:monospace 0
titlebar_padding 1
titlebar_border_thickness 0
# disable titlebar for windows -- end
