set $mod Mod4

set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

set $kws1 1
set $kws2 2
set $kws3 3
set $kws4 4
set $kws5 5
set $kws6 6
set $kws7 7
set $kws8 8
set $kws9 9
set $kws10 0

set $kleft h
set $kdown j
set $kup k
set $kright l

${get_base16('i3', 'colors')}

# property                  border  bg      text    indic   child
client.focused              $base0D $base0D $base00 $base0E $base0D
client.focused_inactive     $base00 $base01 $base05 $base01 $base01
client.unfocused            $base01 $base00 $base05 $base00 $base00
client.urgent               $base08 $base08 $base00 $base08 $base08
client.placeholder          $base01 $base01 $base05 $base01 $base01
client.background           $base07

% for output in host.outputs:
output ${repr(output.match)} {
${output.sway_lines}
}
% endfor

% for input in host.inputs:
input ${repr(input.match)} {
${input.sway_lines}
}
%endfor

gaps inner 8

input type:Mouse accel_profile flat

# auto-float
for_window [title="Firefox — Sharing Indicator"] {
    floating enable
    move position 0 0
}
no_focus [title="Firefox — Sharing Indicator"]

for_window [title="WSJT-X   v2.6.1   by K1JT et al. - Log QSO"] {
    floating enable
}


exec pipewire
exec wireplumber
exec pipewire-pulse
exec swayidle
exec dunst
exec udiskie
exec fcitx5

font pango:${host.system_mono_font} 8
focus_follows_mouse no

floating_modifier $mod

bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+Shift+q kill
bindsym $mod+Shift+p exec ${host.lock_cmd}

# Blank individual displays
bindsym $mod+o output - dpms off
# Unblank all displays
bindsym $mod+Shift+o output * dpms on

bindsym $mod+Return exec ${host.terminal}
bindsym $mod+d exec wofi --show drun
bindsym $mod+Shift+d exec wofi --show run
bindsym $mod+p exec wofi-pass
bindsym $mod+Shift+s exec wl-copy < "$(grimshot --notify save window)"
bindsym $mod+Ctrl+s exec wl-copy < "$(grimshot --notify save area)"

bindsym $mod+$kleft focus left
bindsym $mod+$kdown focus down
bindsym $mod+$kup focus up
bindsym $mod+$kright focus right
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child

bindsym $mod+Shift+$kleft move left
bindsym $mod+Shift+$kdown move down
bindsym $mod+Shift+$kup move up
bindsym $mod+Shift+$kright move right

bindsym $mod+Ctrl+$kleft move workspace to output left
bindsym $mod+Ctrl+$kdown move workspace to output down
bindsym $mod+Ctrl+$kup move workspace to output up
bindsym $mod+Ctrl+$kright move workspace to output right
bindsym $mod+q exec wsc

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

bindsym $mod+b split h
bindsym $mod+v split v
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

bindsym $mod+$kws1 workspace $ws1
bindsym $mod+$kws2 workspace $ws2
bindsym $mod+$kws3 workspace $ws3
bindsym $mod+$kws4 workspace $ws4
bindsym $mod+$kws5 workspace $ws5
bindsym $mod+$kws6 workspace $ws6
bindsym $mod+$kws7 workspace $ws7
bindsym $mod+$kws8 workspace $ws8
bindsym $mod+$kws9 workspace $ws9
bindsym $mod+$kws10 workspace $ws10

bindsym $mod+Shift+$kws1 move container to workspace $ws1
bindsym $mod+Shift+$kws2 move container to workspace $ws2
bindsym $mod+Shift+$kws3 move container to workspace $ws3
bindsym $mod+Shift+$kws4 move container to workspace $ws4
bindsym $mod+Shift+$kws5 move container to workspace $ws5
bindsym $mod+Shift+$kws6 move container to workspace $ws6
bindsym $mod+Shift+$kws7 move container to workspace $ws7
bindsym $mod+Shift+$kws8 move container to workspace $ws8
bindsym $mod+Shift+$kws9 move container to workspace $ws9
bindsym $mod+Shift+$kws10 move container to workspace $ws10

bindsym $mod+Ctrl+$kws1 rename workspace to $ws1
bindsym $mod+Ctrl+$kws2 rename workspace to $ws2
bindsym $mod+Ctrl+$kws3 rename workspace to $ws3
bindsym $mod+Ctrl+$kws4 rename workspace to $ws4
bindsym $mod+Ctrl+$kws5 rename workspace to $ws5
bindsym $mod+Ctrl+$kws6 rename workspace to $ws6
bindsym $mod+Ctrl+$kws7 rename workspace to $ws7
bindsym $mod+Ctrl+$kws8 rename workspace to $ws8
bindsym $mod+Ctrl+$kws9 rename workspace to $ws9
bindsym $mod+Ctrl+$kws10 rename workspace to $ws10

bindsym $mod+y exec wsn
bindsym $mod+Ctrl+y exec wsr

mode "resize" {
    bindsym $kleft resize shrink width 10 px or 10 ppt
    bindsym $kdown resize grow height 10 px or 10 ppt
    bindsym $kup resize shrink height 10 px or 10 ppt
    bindsym $kright resize grow width 10 px or 10 ppt

    bindsym Return mode "default"
    bindsym Escape mode "default"
    bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioPlay exec playerctl play-pause

bar {
    tray_output none
    status_command i3status
    font pango:${host.system_mono_font} 10

${get_base16('i3', 'bar-colors')}

    colors {
        background $base01
        separator $base03
        statusline $base05
    }
}

# Fix for xdg-desktop-portal-wlr
exec dbus-update-activation-environment SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
