### Sway Config
include ~/.config/sway/noctalia

output HDMI-A-1 scale 1.21

set $mod Mod4

#
# Applications
#

set $term alacritty
set $editor emacs
set $filemanager thunar

#
# Outputs
#
#output * bg #111111 solid_color

#
# Appearance
#

seat seat0 xcursor_theme oreo_white_cursors 28
corner_radius 10

default_border pixel 4
default_floating_border pixel 4

gaps inner 8
gaps outer 0

focus_follows_mouse yes

#
# Workspaces
#

workspace 1
workspace 2
workspace 3
workspace 4
workspace 5

#
# Window behaviour
#

floating_modifier $mod

#
# Movement
#

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

#
# Move windows
#

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

#
# Resize
#

mode "resize" {
    bindsym h resize shrink width 20px
    bindsym j resize grow height 20px
    bindsym k resize shrink height 20px
    bindsym l resize grow width 20px

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

bindsym $mod+Shift+r mode "resize"

#
# Split orientation
#

bindsym $mod+v splitv
bindsym $mod+b splith

#
# Fullscreen / floating
#

bindsym $mod+f fullscreen toggle
bindsym $mod+Ctrl+space floating toggle

#
# Kill window
#

bindsym $mod+q kill

#
# Maximize
#

bindsym $mod+m fullscreen disable, floating disable

# Launchers
set $ipc noctalia msg

bindsym $mod+space exec $ipc panel-toggle launcher
bindsym $mod+n exec $ipc panel-toggle control-center
bindsym $mod+s exec $ipc settings-toggle

bindsym $mod+Return exec $editor
bindsym $mod+t exec $term
bindsym $mod+e exec $filemanager

# Screenshot
bindsym $mod+Ctrl+p exec grimshot save area

#
# Window cycling
#

bindsym $mod+Tab focus next

#
# Layouts
#

bindsym $mod+w layout toggle split

#
# Terminal layout reset
#

bindsym $mod+Shift+space layout default

#
# Audio Keys
#

bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle

#
# Workspaces
#

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

#
# Move windows to workspace
#

bindsym $mod+Ctrl+1 move container to workspace number 1
bindsym $mod+Ctrl+2 move container to workspace number 2
bindsym $mod+Ctrl+3 move container to workspace number 3
bindsym $mod+Ctrl+4 move container to workspace number 4
bindsym $mod+Ctrl+5 move container to workspace number 5

#
# Floating rules
#

for_window [app_id="pavucontrol"] floating enable
for_window [app_id="blueman-manager"] floating enable
for_window [title="Event Tester"] floating enable

#
# Reload
#

bindsym $mod+Ctrl+r reload

#
# Exit sway
#

bindsym $mod+Shift+q exit

#
# Mouse
#
bindsym --whole-window $mod+Button1 move
bindsym --whole-window $mod+Button3 resize

# Startup
exec pgrep -x noctalia >/dev/null || noctalia
exec pipewire
