output "Samsung Electric Company LC49G95T H4ZTA00002" {
    mode 5120x1440@119.999001Hz
    allow_tearing yes
    adaptive_sync on
    enable
}

input "type:keyboard" {
    xkb_layout us,il
    xkb_options grp:alt_space_toggle
    repeat_rate 50
    repeat_delay 300
}

input "type:touchpad" {
    tap enabled
    natural_scroll enabled
    dwt enabled
    dwtp enabled
}

# TODO: remove when moving to void linux?
# needed for systemd. see https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments
exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME

# options
font pango:BerkeleyMono 12
titlebar_border_thickness 0
titlebar_padding 4 0
default_border pixel 2
default_floating_border pixel 2
hide_edge_borders smart
smart_borders on
focus_follows_mouse yes
focus_on_window_activation smart
focus_wrapping yes
mouse_warping container
seat * hide_cursor 5000
seat * hide_cursor when-typing enable

# colors
client.background #000000
client.focused #555555 #555555 #ffffff #555555 #555555
client.focused_inactive #000000 #000000 #ffffff #000000 #000000
client.focused_tab_title #000000 #000000 #ffffff
client.unfocused #000000 #000000 #ffffff #000000 #000000
client.urgent #ff0000 #ff0000 #ffffff #ff0000 #ff0000
client.placeholder #000000 #555555 #ffffff #555555 #555555

include ~/.cache/hellwal/sway-colors

# autostart
exec mako
exec hypridle
exec waybar
exec wl-paste --type text --watch cliphist store
exec wl-paste --type image --watch cliphist store
exec udiskie --smart-tray
exec ron-volume-notify
exec ron-background-random ~/pictures/backgrounds

# bindings
set $mod Super
floating_modifier $mod normal

# general
bindsym --no-repeat $mod+R reload, exec notify-send "reloaded sway config"
bindsym --no-repeat $mod+Q kill
bindsym --no-repeat $mod+Escape exec hyprlock
bindsym --no-repeat --locked $mod+Alt+Control+Shift+Escape exit

# windows
bindsym $mod+H focus left
bindsym $mod+J focus down
bindsym $mod+K focus up
bindsym $mod+L focus right

bindsym $mod+F focus mode_toggle
bindsym $mod+Alt+F floating toggle

bindsym $mod+Shift+H move left 50px
bindsym $mod+Shift+J move down 50px
bindsym $mod+Shift+K move up 50px
bindsym $mod+Shift+L move right 50px

bindsym $mod+Ctrl+Shift+H exec sway-move-edge left
bindsym $mod+Ctrl+Shift+J exec sway-move-edge down
bindsym $mod+Ctrl+Shift+K exec sway-move-edge up
bindsym $mod+Ctrl+Shift+L exec sway-move-edge right

bindsym $mod+Ctrl+H resize shrink width 50px or 5 ppt
bindsym $mod+Ctrl+L resize grow width 50px or 5 ppt
bindsym $mod+Ctrl+J resize shrink height 50px or 5 ppt
bindsym $mod+Ctrl+K resize grow height 50px or 5 ppt

bindsym $mod+Shift+M fullscreen toggle

# workspaces
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

bindsym $mod+Shift+1 move container to workspace 1, workspace 1
bindsym $mod+Shift+2 move container to workspace 2, workspace 2
bindsym $mod+Shift+3 move container to workspace 3, workspace 3
bindsym $mod+Shift+4 move container to workspace 4, workspace 4
bindsym $mod+Shift+5 move container to workspace 5, workspace 5
bindsym $mod+Shift+6 move container to workspace 6, workspace 6
bindsym $mod+Shift+7 move container to workspace 7, workspace 7
bindsym $mod+Shift+8 move container to workspace 8, workspace 8
bindsym $mod+Shift+9 move container to workspace 9, workspace 9
bindsym $mod+Shift+0 move container to workspace 10, workspace 10

# menus
bindsym --no-repeat $mod+Space exec fuzzel
bindsym --no-repeat $mod+Period exec ron-menu-unified
bindsym --no-repeat $mod+Shift+Escape exec ron-menu-power
bindsym --no-repeat $mod+S exec ron-capture-screenshot --region=region
bindsym --no-repeat $mod+Alt+S exec ron-capture-screenrecord --region=region
bindsym --no-repeat $mod+C exec ron-menu-clip
bindsym --no-repeat $mod+Alt+C exec ron-menu-clip-img
bindsym --no-repeat $mod+Shift+C exec ron-color-picker
bindsym --no-repeat $mod+P exec tessen
bindsym --no-repeat $mod+E exec rofimoji --selector=fuzzel --skin-tone=medium-light --prompt='emoji> '
bindsym --no-repeat $mod+Shift+T exec ron-theme-set toggle

# spawn
bindsym --no-repeat $mod+Return exec ghostty
bindsym --no-repeat $mod+Shift+Return exec qutebrowser
bindsym --no-repeat $mod+Alt+Shift+Return exec qutebrowser --target private-window

# notifications
bindsym --no-repeat $mod+N exec makoctl invoke
bindsym --no-repeat $mod+Ctrl+N exec makoctl dismiss
bindsym --no-repeat $mod+Shift+N exec makoctl dismiss --all

# media
bindsym XF86AudioRaiseVolume exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+ -l 1.0"
bindsym XF86AudioLowerVolume exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
bindsym --no-repeat XF86AudioMute exec "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
bindsym $mod+XF86AudioRaiseVolume exec "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+ -l 1.0"
bindsym $mod+XF86AudioLowerVolume exec "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-"
bindsym $mod+XF86AudioMute exec "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
bindsym --no-repeat XF86AudioMicMute exec "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
bindsym --no-repeat XF86AudioPlay exec "playerctl play-pause"
bindsym --no-repeat XF86AudioPause exec "playerctl play-pause"
bindsym --no-repeat XF86AudioStop exec "playerctl stop"
bindsym --no-repeat XF86AudioPrev exec "playerctl previous"
bindsym --no-repeat XF86AudioNext exec "playerctl next"
bindsym XF86MonBrightnessUp exec "brightnessctl set +10%"
bindsym XF86MonBrightnessDown exec "brightnessctl set 10%-"

# rules
for_window [all] inhibit_idle fullscreen
for_window [app_id="ron.terminal.floating"] floating enable
for_window [app_id="^swayimg-picker$"] fullscreen enable
for_window [app_id="^webcam$"] floating enable
