# ────────────────────────────────────────────────────────────────────
#          ╭────────────────────────────────────────────────╮
#          │             LAUNCHING OF PROGRAMS              │
#          ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────

source = ./colors.conf
exec-once = ~/.config/hypr/xdg-portal-hyprland
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XAUTHORITY DISPLAY
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# exec-once = waybar
exec-once = hypridle
exec-once = nm-applet
exec-once = nextcloud --background
exec-once = sleep 2 && bash -c "ags run -d ~/projects/dotfiles/config/astal/ --gtk 4 >> /tmp/runner-log 2>&1"
# exec-once = sleep 2 && bash -c "ags run -d ~/projects/active/dotfiles/config/astal/ --gtk4"
exec-once = bash -c "ags run -d ~/projects/dotfiles/config/ags/notifications/ --gtk 3 >> /tmp/notifier-log 2>&1"
# exec-once = bash -c "ags run -d ~/projects/active/dotfiles/config/ags/notifications/"

# ── wlhist ──────────────────────────────────────────────────────────
exec-once = wl-paste --type text --watch cliphist store # Stores only text data
exec-once = wl-paste --type image --watch cliphist store # Stores only image data


exec = hyprctl setcursor oreo_spark_blue_cursors 24
env = QT_QPA_PLATFORM,wayland
env = QT_QPA_PLATFORM_THEME,qt6ct
env = OLLAMA_HOST,0.0.0.0

# ────────────────────────────────────────────────────────────────────
#          ╭────────────────────────────────────────────────╮
#          │                     INPUT                      │
#          ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────
input {
    kb_layout = ch
    kb_options = caps:swapescape
    natural_scroll = true

    numlock_by_default = true
    repeat_delay = 400

    follow_mouse = 2
    mouse_refocus = true

    touchpad {
        disable_while_typing = true
        natural_scroll = true
    }

    focus_on_close = 1

    sensitivity = 0
}


# ── Cursors ─────────────────────────────────────────────────────────
cursor {
    no_warps = false
    inactive_timeout = 5
}


# ── Bind config ─────────────────────────────────────────────────────
binds {
    workspace_back_and_forth = true
}


# ── Gestures ────────────────────────────────────────────────────────
gestures {
    workspace_swipe_distance = 200
    workspace_swipe_cancel_ratio = 0.3
    workspace_swipe_forever = true
    workspace_swipe_direction_lock = false
}

gesture = 3, horizontal, workspace,
gesture = 3, down, close
gesture = 3, up, fullscreen


# ────────────────────────────────────────────────────────────────────
#          ╭────────────────────────────────────────────────╮
#          │                 GENERAL CONFIG                 │
#          ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────
general {
    gaps_in = 3
    gaps_out = 4
    border_size = 2

    layout = dwindle
    no_border_on_floating = false
}


# ────────────────────────────────────────────────────────────────────
#          ╭────────────────────────────────────────────────╮
#          │                     Style                      │
#          ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────
decoration {
    inactive_opacity = 1
    rounding = 10

    shadow {
        enabled = true
        range = 4
    }

    blur {
        enabled = true
        xray = true
        new_optimizations = true
        size = 1
        passes = 2
    }
    dim_inactive = true
    dim_strength = 0.1
}

animations {
    enabled = yes

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 4, myBezier
    animation = windowsOut, 1, 6, default, popin 80%
    animation = border, 1, 8, default
    animation = fade, 1, 3, default
    animation = workspaces, 1, 2, default
    animation = specialWorkspaceIn, 1, 2, default, fade
    animation = specialWorkspaceOut, 1, 2, default, fade
}

misc {
    disable_hyprland_logo = true
    disable_splash_rendering = false
    vrr = 3
    allow_session_lock_restore = true
}

dwindle {
    pseudotile = true
    force_split = 2
    preserve_split = true
}
