# Variables
set $mod Mod4
set $term kitty
set $filemanager kitty -e yazi
set $browser librewolf
set $menu rofi -show drun


# General
floating_modifier $mod normal


# Output
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
output * bg ~/.wallpapers/saoswords.png fill
output * allow_tearing yes
output DP-1 {
	mode 2560x1440@179.959Hz
	position 0 400
	adaptive_sync on
}
output HDMI-A-1 {
	mode 1920x1080@59.939Hz
	position 2560 0
	transform 270
}


# Input configuration

input "type:keyboard" xkb_options caps:escape
input "type:mouse" {
	natural_scroll disabled
	accel_profile "flat"
	pointer_accel -1
}


# Key bindings

	## Spawn
	bindsym $mod+Return exec $term
	bindsym $mod+Shift_R exec $filemanager
	bindsym $mod+Control_R exec $browser
	bindsym Menu exec $menu

	## Utilities

	bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
	bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
	bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
	bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
	bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
	bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
	bindsym Print exec grim

	## Window Management
	bindsym $mod+e kill
	bindsym $mod+b splith
	bindsym $mod+v splitv
	bindsym $mod+s layout stacking
	bindsym $mod+w layout tabbed
	bindsym $mod+f fullscreen
	bindsym $mod+Shift+space floating toggle
	bindsym $mod+space focus mode_toggle
	bindsym $mod+a focus parent
	bindsym $mod+r reload
	bindsym $mod+End exec swaymsg exit

	## Window Controls

		### Focus windows

			#### Vim-style
			bindsym $mod+h focus left
			bindsym $mod+j focus down
			bindsym $mod+k focus up
			bindsym $mod+l focus right

			#### Arrows
			bindsym $mod+Left focus left
			bindsym $mod+Down focus down
			bindsym $mod+Up focus up
			bindsym $mod+Right focus right

		### Move windows

			#### Vim-style
			bindsym $mod+Shift+h move left
			bindsym $mod+Shift+j move down
			bindsym $mod+Shift+k move up
			bindsym $mod+Shift+l move right

			#### Arrows
			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 windows

			#### Vim-style
			bindsym $mod+Control+h resize shrink width 5 px or 5 ppt
			bindsym $mod+Control+j resize grow height 5 px or 5 ppt
			bindsym $mod+Control+k resize shrink height 5 px or 5 ppt
			bindsym $mod+Control+l resize grow width 5 px or 5 ppt

			#### Arrows
			bindsym $mod+Control+Left resize shrink width 5 px or 5 ppt
			bindsym $mod+Control+Down resize grow height 5 px or 5 ppt
			bindsym $mod+Control+Up resize shrink height 5 px or 5 ppt
			bindsym $mod+Control+Right resize grow width 5 px or 5 ppt


# Workspaces

	## Define
	workspace 1 output DP-1
	workspace 2 output DP-1
	workspace 3 output DP-1
	workspace 4 output DP-1
	workspace 5 output DP-1
	workspace "alt" output HDMI-A-1

	## Focus
	bindsym $mod+1 workspace number 1 
	bindsym $mod+2 workspace number 2
	bindsym $mod+3 workspace number 3
	bindsym $mod+4 workspace number 4
	bindsym $mod+5 workspace number 5
	bindsym $mod+q workspace "alt"

	## Move
	bindsym $mod+Shift+1 move container to workspace number 1
	bindsym $mod+Shift+2 move container to workspace number 2
	bindsym $mod+Shift+3 move container to workspace number 3
	bindsym $mod+Shift+4 move container to workspace number 4
	bindsym $mod+Shift+5 move container to workspace number 5
	bindsym $mod+Shift+q move container to workspace "alt"

	## Scratchpad
	bindsym $mod+Shift+minus move scratchpad
	bindsym $mod+minus scratchpad show

# Status Bar
bar {
    position top

    # When the status_command prints a new line to stdout, swaybar updates.
    # The default just shows the current date and time.
    status_command while date +'%Y-%m-%d %X'; do sleep 1; done

    colors {
        statusline #ffffff
        background #323232
        inactive_workspace #32323200 #32323200 #5c5c5c
    }
}

# Include Global Settings
include /etc/sway/config.d/*
