# {{@@ header() @@}}
#  _____      ____ _ _   _
# / __\ \ /\ / / _` | | | |
# \__ \\ V  V / (_| | |_| |
# |___/ \_/\_/ \__,_|\__, |
#                    |___/

###############################################################
# Variables
###############################################################

# Logo key.
set $mod Mod4

# mouse button for dragging.
floating_modifier $mod normal

# Home row direction keys, like vim
set $Left       {{@@ key.left  @@}}
set $Down       {{@@ key.down  @@}}
set $Up         {{@@ key.up    @@}}
set $Right      {{@@ key.right @@}}
set $tabL       {{@@ key.tabL  @@}}
set $tabR       {{@@ key.tabR  @@}}
set $lock       {{@@ key.next  @@}}
set $menu       {{@@ key.menu  @@}}

###############################################################
# Includes
###############################################################

include input

include visual

include keys-window
include keys-run
include keys-special
include modes

include assigns

{%@@ if supervisor == "runit" @@%}
    set $user_svd "{{@@ user_svdir @@}}"
    exec_always pgrep -u "$USER" "^runsvdir$" || runsvdir $user_svd
    exec_always env SVDIR=$user_svd sv hup kanshi
    exec_always _gpg-unlock
{%@@ elif supervisor == "systemd" @@%}
    exec "systemctl --user import-environment; systemctl --user start sway-session.target"
{%@@ else @@%}
    include daemons
{%@@ endif @@%}

exec light -N 1
exec dbus-update-activation-environment DISPLAY XAUTHORITY SWAYSOCK I3SOCK WAYLAND_DISPLAY

# Prevent the screen from locking if fullscreen
for_window [title=.*] inhibit_idle fullscreen

include /etc/sway/config.d/

# vim:ft=i3
