#     __                 __             __
#    / /  __ _____  ____/ /__ ____  ___/ /
#   / _ \/ // / _ \/ __/ / _ `/ _ \/ _  / 
#  /_//_/\_, / .__/_/ /_/\_,_/_//_/\_,_/  
#       /___/_/                           

### MONITORS ###

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1

source = ~/.config/hypr/keybinds.conf

### MY PROGRAMS ###

# See https://wiki.hyprland.org/Configuring/Keywords/

### AUTOSTART ###

exec-once=systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=Hyprland
exec-once=dbus-update-activation-environment --systemd --all &
exec-once=blueman-applet
exec-once=/usr/lib/polkit-kde-authentication-agent-1
#exec-once=/usr/lib/xfce-polkit/xfce-polkit
#exec-once = systemctl --user start hyprpolkitagent
exec-once=dbus-update-activation-environment --systemd --all &
exec-once=swaync
#exec-once=dbus-launch --sh-syntax --exit-with-session dunst -conf ~/.config/dunst/dunstrc 
exec-once=/usr/lib/kdeconnectd
exec-once=kdeconnect-indicator

# clipboard
exec-once=wl-paste --type text --watch cliphist store
exec-once=wl-paste --type image --watch cliphist store

# exec-once=hyprpaper
# exec-once=~/.local/bin/hyprpaperchanger
#exec-once=wpaperd
#exec-once=hypridle
exec-once=~/.config/hypr/hypridle_launch.sh
exec-once=swww-daemon --format xrgb
exec-once=hyprshade auto
exec-once=waybar
exec-once=~/.config/hypr/xdg-desktop-portal.sh
exec-once=kanshi
exec-once=wlsunset -l 45.424721 -L -75.695000
exec-once=/usr/lib/kdeconnectd
exec-once=kdeconnect-indicator
exec-once=blueman-applet
exec-once=systemctl --user restart sunshine.service
##exec-once=nwg-dock-hyprland -i 32 -w 5 -mb 10 -ml 10 -mr 10 -x -c "tofi-drun --drun-launch=true" -lp start -f -a start
exec-once=pypr



### ENVIRONMENT VARIABLES ###

env = XCURSOR_SIZE,24
#env = XCURSOR_THEME,Bibata-Modern-Classic
env = HYPRCURSOR_SIZE,24
#env = HYPRCURSOR_THEME,Bibata-Modern-Classic
env = XDG_MENU_PREFIX,arch-

# Firefox
env = MOZ_ENABLE_WAYLAND,1

# Nvidia
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia # remove if firefox crashes
env = NVD_BACKEND,direct
env = ELECTRON_OZONE_PLATFORM_HINT,auto

# QT
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_QPA_PLATFORMTHEME,qt6ct
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_AUTO_SCREEN_SCALE_FACTOR,1

# Toolkit Backend Variables
env = GDK_BACKEND,wayland,x11
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland

# XDG Specifications
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland

### LOOK AND FEEL ###

general {
    gaps_in = 5
    gaps_out = 5
    border_size = 2
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)
    allow_tearing = false
    layout = dwindle
    #layout = master
    resize_on_border = true
    hover_icon_on_border = true
}

# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
    rounding = 10

    active_opacity = 1.0
    inactive_opacity = 0.9

    shadow {
        enabled = true
        range = 4
        render_power = 3
        color = rgba(1a1a1aee)
    }

    blur {
        enabled = true
        size = 3
        passes = 3
        new_optimizations = true
        vibrancy = 0.1696
        ignore_opacity = true
    }
}

animations {
    enabled = true

    # bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    #
    # animation = windows, 1, 7, myBezier
    # animation = windowsOut, 1, 7, default, popin 80%
    # animation = border, 1, 10, default
    # animation = borderangle, 1, 8, default
    # animation = fade, 1, 7, default
    # animation = workspaces, 1, 6, default
    bezier = wind, 0.05, 0.9, 0.1, 1.05
    bezier = winIn, 0.1, 1.1, 0.1, 1.1
    bezier = winOut, 0.3, -0.3, 0, 1
    bezier = liner, 1, 1, 1, 1
    animation = windows, 1, 6, wind, slide
    animation = windowsIn, 1, 6, winIn, slide
    animation = windowsOut, 1, 5, winOut, slide
    animation = windowsMove, 1, 5, wind, slide
    animation = border, 1, 1, liner
    animation = borderangle, 1, 30, liner, loop
    animation = fade, 1, 10, default
    animation = workspaces, 1, 5, wind
}

dwindle {
    pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = true # You probably want this
    force_split = 2
}

master {
#    new_status = master
    new_status = inherit
    mfact = 0.50
}

misc {
    force_default_wallpaper = 0
    disable_hyprland_logo = true
    disable_splash_rendering = true
    vrr = 0
}


### INPUT ###

input {
    kb_layout = us,ca
    kb_variant =
    kb_model =
    kb_options = grp:alt_shift_toggle
    kb_rules =

    follow_mouse = 1

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.

    touchpad {
        natural_scroll = false
    }
}

gestures {
    workspace_swipe = false
}

device {
    name = epic-mouse-v1
    sensitivity = -0.5
}

##############################
### WINDOWS AND WORKSPACES ###
##############################

# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules

# Example windowrule v1
# windowrule = float, ^(kitty)$

# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$

# Ignore maximize requests from apps. You'll probably like this.
windowrulev2 = suppressevent maximize, class:.*

# Fix some dragging issues with XWayland
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
windowrulev2 = float, class:(LibreWolf), title:(Picture-in-Picture)
windowrulev2 = move 100%-w-20 50, title:(Picture-in-Picture)
windowrulev2 = size 320 180, title:(Picture-in-Picture)
windowrulev2 = pin, title:(Picture-in-Picture)

# windowrulev2 = opacity 0.80 0.80,class:^(kitty)$

windowrule = float,^(jome)$

windowrulev2 = float,class:^(org.remmina.Remmina)$
windowrule = fullscreen,^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
# Fix Bitwarden Window
windowrulev2 = suppressevent maximize, class:^(firefox)$
exec-once = ./hyprland-bitwarden-resize.sh

layerrule = ignorezero,wofi
layerrule = ignorezero,swaync
layerrule = blur,swaync
