### Input configuration
#
# Read `man 5 sway-input` for more information about this section.

# Touchpad configuration
input type:touchpad {
    dwt enabled
    tap enabled
    #natural_scroll enabled
}

bindgesture {
    swipe:right workspace prev
    swipe:left exec ~/.config/sway/scripts/advance_workspace.sh
    swipe:up move scratchpad
    swipe:down scratchpad show
}

# Enable numlock by default
input type:keyboard xkb_numlock enabled

# Set keyboard layout and variant based on current system settings
exec_always {
    'swaymsg input type:keyboard xkb_layout "$(localectl status | grep "X11 Layout" | sed -e "s/^.*X11 Layout://")"'
    'swaymsg input type:keyboard xkb_variant "$(localectl status | grep "X11 Variant" | sed -e "s/^.*X11 Variant://")"'
}

# # Uncomment below to toggle between keyboard layouts.
# # The commented example has the "us" and "gb" keyboard layouts, and uses Alt+Shift to toggle between them.
#
# input "type:keyboard" {
#     xkb_layout "us,gb"
#     xkb_options "grp:alt_shift_toggle"
# }
#
# # Assign the same binding to "pkill -RTMIN+1 waybar" to send signal to the Waybar keyboard module.
# # The signal refreshes the module. The commented example uses Alt + left Shift.
#
# bindsym Alt+Shift_L exec "pkill -RTMIN+1 waybar"
