# ============================================================================
# hyprland.conf — Main Hyprland compositor configuration
#
# This is the entry point for the Hyprland window manager config. It sources
# all per-user split configs (input, monitors, env vars, keybinds, etc.) from
# ~/.config/ symlinks so that user preferences live in one place and are
# independent of the DE source tree.
#
# Split config pattern: instead of one huge file, settings are broken into
# focused files (input.conf, binds.conf, etc.) and loaded via `source =`.
# The files in hypr-usr/ are symlinked to ~/.config/ during setup.
# ============================================================================

# ── Split config sources ────────────────────────────────────────────────────
# Each `source` directive merges the named file into this config at runtime.
# These files live under hypr-usr/ and are symlinked into ~/.config/ by the
# setup scripts, allowing machine-local overrides without touching the repo.
source = ~/.config/input.conf        # Keyboard layout, mouse sensitivity, touchpad
source = ~/.config/monitors.conf     # Monitor resolution, scale, rotation rules
source = ~/.config/envvars.conf      # Wayland/GTK/QT environment variable exports
source = ~/.config/binds.conf        # All keybindings and gestures
source = ~/.config/windowrules.conf  # Per-app window placement and behaviour rules
source = ~/.config/autostart.conf    # exec-once applications started with the session

# ── Disabled hyprexpo plugin (commented out) ───────────────────────────────
# hyprexpo provides a grid overview of all workspaces (like GNOME Activities).
# Disabled because the gesture-based workspace navigation in binds.conf already
# covers this use case without requiring a compiled plugin.
#plugin {
#    hyprexpo {
#        columns = 3
#        gap_size = 1
#        bg_col = rgb(111111)
#        workspace_method = first 1 # [center/first] [workspace] e.g. first 1 or center m+1
#
#        enable_gesture = true # laptop touchpad
#        gesture_fingers = 3  # 3 or 4
#        gesture_distance = 300 # how far is the "max"
#        gesture_positive = true # positive = swipe down. Negative = swipe up.
#    }
#}
# https://wiki.hyprland.org/Configuring/Variables/#gestures

# Eample per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
# Per-device overrides let you set sensitivity for a specific mouse independently
# of the global input sensitivity. "epic-mouse-v1" is the Hyprland device id;
# run `hyprctl devices` to find the correct identifier for connected hardware.
device {
    name = epic-mouse-v1
    sensitivity = -0.5  # Negative = faster pointer; 0 = raw, no acceleration applied
}


#autogenerated = 0 # remove this line to remove the warning

# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/

# Please note not all available settings / options are set here.
# For a full list, see the wiki

# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf

###################
### MY PROGRAMS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/
# Set programs that you use
# These $variables are referenced in keybindings (binds.conf) so changing the
# program here automatically updates every keybind that uses it.
$terminal = kitty              # Primary terminal emulator
$fileManager = kitty -e yazi  # TUI file manager (yazi) launched inside kitty
$editor = kitty micro         # Text editor (micro) launched in a terminal window
$menu = wofi --show=drun      # Application launcher — overridden by vicinae in binds.conf


#################
### AUTOSTART ###
#################

# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Actual exec-once lines are in ~/.config/autostart.conf (sourced above).
# This section header is kept here as a readability landmark.




#####################
### LOOK AND FEEL ###
#####################

# Refer to https://wiki.hyprland.org/Configuring/Variables/

# ── general: tiling gaps, borders, and layout ──────────────────────────────
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
    # gaps_in: space (px) between individual tiled windows inside a workspace.
    # Small value keeps windows visually separated without wasting screen space.
    gaps_in = 3
    # gaps_out: space (px) between the outermost windows and the monitor edge.
    # Slightly larger than gaps_in so the screen frame is clearly visible.
    gaps_out = 6

    # border_size: width of the coloured border drawn around each window (px).
    # 4 px is prominent on a high-DPI display and reinforces the active window.
    border_size = 4

    # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
    # col.active_border: gradient applied to the focused window's border.
    # Multi-stop gradient: primary red (#E40046) → deeper red (#f50505) at 35°,
    # creating a crimson animated border matching the cyberqueer colour theme.
    #col.active_border = rgb(E40046) rgb(fc0588) 40deg
    col.active_border = rgb(E40046) rgb(f50505) rgb(E40046) rgb(f50505) rgb(E40046) 35deg

    # col.inactive_border: solid electric blue (#5018DD) for unfocused windows.
    # This is the secondary accent colour of the cyberqueer palette.
    col.inactive_border = rgb(5018dd)

    # Set to true enable resizing windows by clicking and dragging on borders and gaps
    # Disabled because it conflicts with gap-hover interactions on touch screens.
    resize_on_border = false

    # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
    # allow_tearing permits screen tearing for lower latency in games.
    # Disabled — visual quality preferred; enable per-app via windowrule if needed.
    allow_tearing = false


    # layout: default tiling algorithm for new windows.
    # "dwindle" splits the screen recursively (like bspwm).
    # Toggle between dwindle/master at runtime via toggle-layout.sh.
    layout = dwindle

}

# ── group: window grouping (tabbed windows) ─────────────────────────────────
# Groups let multiple windows share the same screen tile, switchable via a tab bar.
group {

    # Border colours for grouped windows mirror the main active/inactive palette.
	col.border_active = rgb(E40046)          # Hot pink/red — focused group border
	col.border_inactive = rgb(5018dd)        # Electric blue — unfocused group border
	col.border_locked_active = rgb(f50505)   # Deeper red — locked (pinned) active group
	col.border_locked_inactive = rgb(5018dd) # Same blue for locked inactive group

	#rounding = 10  # Commented — would override global rounding just for groups

    # groupbar: the tab strip shown above grouped windows.
	groupbar {
        # font_family: Agave NerdFont provides the Nerd Font icon glyphs used
        # throughout the system (bar, lock screen, etc.).
		font_family = Agave NerdFont
        # font_size: 20pt readable at 2× HiDPI scaling without being too large.
		font_size = 20
        # height: total height of the groupbar strip in pixels.
		height = 25
        # round_only_edges = false means all corners are rounded, not just outer.
		round_only_edges = false
        # indicator_height: height of the coloured active-tab underline indicator.
		indicator_height = 25
        # stacked = false: tabs displayed horizontally side-by-side (not vertically).
		stacked = false

        # text_color: tab label colour — primary accent red.
		text_color = rgb(E40046)

        # priority: render order vs other decorations (shadows etc.).
        # 3 = high priority so the groupbar appears on top of other decorations.
		priority = 3

        # rounding: corner radius for the tab bar itself — pill-shaped appearance.
		rounding = 13
        # Active tab background — red accent to show which tab is selected.
		col.active = rgb(E40046)
        # Inactive tab backgrounds — blue to distinguish non-selected tabs.
		col.inactive = rgb(5018dd)

        # Locked group tab colours (same as unlocked for visual consistency).
		col.locked_active = rgb(E40046)
		col.locked_inactive = rgb(5018dd)
	}
}

# ── decoration: window rounding, transparency, and blur ─────────────────────
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
    # rounding: window corner radius in pixels. 20px gives a modern, rounded
    # look consistent with the GTK cyberqueer theme's rounded widgets.
    rounding = 20

    # Change transparency of focused and unfocused windows
    # active_opacity: focused window is fully opaque (1.0 = 100%).
    # Keeps the active window readable while inactive windows recede visually.
    active_opacity = 1
    # inactive_opacity: unfocused windows are 80% opaque so the blurred
    # wallpaper shows through slightly, creating depth perception.
    inactive_opacity = 0.8
    # Drop shadow disabled: coloured borders already provide sufficient depth cues.
    #drop_shadow = true
    #shadow_range = 4
    #shadow_render_power = 3
    #col.shadow = rgba(1a1a1aee)

    # https://wiki.hyprland.org/Configuring/Variables/#blur
    # blur: Gaussian-style background blur behind transparent/inactive windows.
    blur {
        enabled = true
        # size: blur kernel radius — 3 is subtle and not GPU-heavy.
        size = 3
        # passes: number of blur iterations — 3 gives a smooth result without
        # excessive GPU cost. More passes = smoother blur but heavier rendering.
        passes = 3

        # vibrancy: boosts colour saturation of the blurred background content.
        # 0.1696 ≈ 17% vibrancy — subtle colour pop behind transparent windows.
        vibrancy = 0.1696
    }
}

# ── animations ──────────────────────────────────────────────────────────────
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
    enabled = true

    # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    # bezier: defines a named cubic Bézier easing curve.
    # myBezier (0.05, 0.9, 0.1, 1.05) — fast start, slight spring overshoot.
    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    # animation = <event>, <enabled 0/1>, <speed>, <curve>[, <style>]
    # speed: lower = slower animation; style is an optional named effect.

    # Window open/move: spring curve at speed 7 — snappy but not jarring.
    animation = windows, 1, 7, myBezier
    # Window close: "popin" effect shrinks the window from 80% size on close.
    animation = windowsOut, 1, 7, default, popin 80%
    # Border colour transition (gradient rotation): default easing, speed 10.
    animation = border, 1, 10, default
    # Border angle animation (rotating gradient sweep): speed 8.
    animation = borderangle, 1, 8, default
    # Fade in/out for opacity transitions: speed 7.
    animation = fade, 1, 7, default
    # Workspace slide animations are disabled — vertical slide is used for the
    # special/scratchpad workspace only (see specialWorkspace below).
    #animation = workspaces, 1, 6, default
    #animation = workspaces,1,5,default,slidevert
    # Special workspace (scratchpad "magic"): slides in/out vertically at speed 10.
    animation = specialWorkspace, 1, 10, default, slidevert
}

# ── dwindle layout ──────────────────────────────────────────────────────────
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
    #pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    # preserve_split: keeps the split direction when a window is removed.
    # Without this, removing a child window can unexpectedly flip the split axis.
    preserve_split = true # You probably want this
    # special_scale_factor: scratchpad workspace windows fill 95% of the monitor,
    # leaving a small visible border around the floating overlay.
    special_scale_factor = 0.95
}

# ── master layout ───────────────────────────────────────────────────────────
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
    # new_status: new windows open as the "master" (primary, largest) pane.
    # Alternative value "slave" would stack new windows alongside the master.
    new_status = master
    # special_scale_factor: same 95% fill for the scratchpad in master mode.
    special_scale_factor = 0.95
}

# ── misc ────────────────────────────────────────────────────────────────────
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
    force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
    # 0 = disable Hyprland's built-in wallpaper; hyprpaper manages wallpapers instead.
    disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
}
