
# https://wiki.hyprland.org/Configuring/Configuring-Hyprland/

# THEME
#source = ~/.config/hypr/mocha.conf
source = $HOME/.config/hypr/wallust/wallust-hyprland.conf #
source = $HOME/.config/hypr/keybinds.conf
source = $HOME/.config/hypr/UserConfigs/ENVariables.conf

# MONITORS 

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
monitor=DP-3,preferred,auto,1.6

# MY PROGRAMS 

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

# Set programs that you use
$scriptsDir = $HOME/.config/hypr/scripts
$UserScripts = $HOME/.config/hypr/UserScripts
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
$wallDIR = $HOME/Pictures/wallpapers
$lock = $scriptsDir/LockScreen.sh
$SwwwRandom = $UserScripts/WallpaperAutoChange.sh

# AUTOSTART
exec-once = swww-daemon --format xrgb
#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes #
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP #
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP #
##exec-once = hyprpaper
exec-once = hypridle
exec-once = ~/.config/hypr/scripts/waybar.sh
exec-once = nm-applet --indicator & #
exec-once = swaync & #
exec-once = blueman-applet & #
exec-once = pypr & #

##exec-once = systemctl --user start plasma-polkit-agent
exec-once = $scriptsDir/Polkit.sh
exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store
##exec-once = mako
# exec-once = dunst -conf ~/.config/dunst/dunstrc

# ENVIRONMENT VARIABLES

env = XDG_SESSION_TYPE,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24


# LOOK AND FEEL

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

# https://wiki.hyprland.org/Configuring/Variables/#general
general { 
    gaps_in = 5
    gaps_out = 10
    border_size = 2
    col.active_border = 0xffcba6f7
    col.inactive_border = 0xff313244
    no_border_on_floating = true
    resize_on_border = true 
    allow_tearing = false
    layout = dwindle
}

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

    active_opacity = 1.0
    inactive_opacity = 0.9
    fullscreen_opacity = 1.0
    
    dim_inactive = true
    dim_strength = 0.1
    dim_special = 0.8

    drop_shadow = true
    shadow_range = 6
    shadow_render_power = 1

#    shadow_ignore_window = true
#    shadow_range = 4
#    shadow_offset = 2 2
#    shadow_render_power = 2
    col.shadow = 0x66000000
    col.shadow_inactive = 0x50000000

    blur {
        enabled = true
        size = 6
        passes = 2
        new_optimizations = true
        ignore_opacity = true #
        special = true #
        #vibrancy = 0.1696
    }
}

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

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

#    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    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
    bezier = overshot, 0.05, 0.9, 0.1, 1.05
    bezier = smoothOut, 0.5, 0, 0.99, 0.99
    bezier = smoothIn, 0.5, -0.5, 0.68, 1.5

    animation = windows, 1, 6, wind, slide
    animation = windowsIn, 1, 5, winIn, slide
    animation = windowsOut, 1, 3, smoothOut, slide
    animation = windowsMove, 1, 5, wind, slide
    animation = border, 1, 1, liner
    animation = borderangle, 1, 180, liner, loop #used by rainbow borders and rotating colors
    animation = fade, 1, 3, smoothOut
    animation = workspaces, 1, 5, overshot

#    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
}

# 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 = true # You probably want this
}

# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
    new_status = master
    new_on_top = true
}

# https://wiki.hyprland.org/Configuring/Variables/#misc
misc { 
    force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
    disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
    disable_splash_rendering = true
    vfr = true
    #vrr = 0
    mouse_move_enables_dpms = true
    enable_swallow = true
    swallow_regex = ^(kitty)$
    focus_on_activate = false
    #no_direct_scanout = true #for fullscreen games - deprecated
    initial_workspace_tracking = 0
    middle_click_paste = false
}

# INPUT 

# https://wiki.hyprland.org/Configuring/Variables/#input
input {
    kb_layout = us,ca
    kb_variant =
    kb_model =
    kb_options = grp:win_space_toggle
    kb_rules =
    repeat_rate = 50 #
    repeat_delay = 300 #



    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
    numlock_by_default = true
    left_handed = false
    follow_mouse = true
    float_switch_override_focus = false

    touchpad {
        natural_scroll = false
        disable_while_typing = true
        clickfinger_behavior = false
        middle_button_emulation = true
        tap-to-click = true
        drag_lock = false
    }

    # added
    touchdevice {
      enabled = true
    }

    tablet {
      transform = 0
      left_handed = 0
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
    workspace_swipe = true
    workspace_swipe_fingers = 3
    workspace_swipe_distance = 500
    workspace_swipe_invert = true
    workspace_swipe_min_speed_to_force = 30
    workspace_swipe_cancel_ratio = 0.5
    workspace_swipe_create_new = true 
    workspace_swipe_forever = true
    #workspace_swipe_use_r = true #uncomment if wanted a forever create a new workspace with swipe right
}
# added
group {
  col.border_active = $color15
  groupbar {
    col.active = $color0
  }
}

binds {
  workspace_back_and_forth = true
  allow_workspace_cycles = true
  pass_mouse_when_bound = false
}

#Could help when scaling and not pixelating
xwayland {
  force_zero_scaling = true
}

# render section for Hyprland >= v0.42.0
render {
  explicit_sync = 2
  explicit_sync_kms = 2
  direct_scanout = false
}

cursor {
  no_hardware_cursors = false
  enable_hyprcursor = true
  warp_on_change_workspace = true
  no_warps = true 
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
#device {
#    name = epic-mouse-v1
#    sensitivity = -0.5
#}


# KEYBINDINGS

# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier

### # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
### bind = $mainMod, RETURN, exec, $terminal
### bind = $mainMod, C, killactive,
### bind = $mainMod, M, exit,
### bind = $mainMod, E, exec, $fileManager
### bind = $mainMod, V, togglefloating,
### bind = $mainMod, R, exec, $menu
### bind = $mainMod, P, pseudo, # dwindle
### bind = $mainMod, J, togglesplit, # dwindle
### bind = $mainMod, L, exec, hyprlock
### 
### # Move focus with mainMod + arrow keys
### bind = $mainMod, left, movefocus, l
### bind = $mainMod, right, movefocus, r
### bind = $mainMod, up, movefocus, u
### bind = $mainMod, down, movefocus, d
### 
### # Switch workspaces with mainMod + [0-9]
### bind = $mainMod, 1, workspace, 1
### bind = $mainMod, 2, workspace, 2
### bind = $mainMod, 3, workspace, 3
### bind = $mainMod, 4, workspace, 4
### bind = $mainMod, 5, workspace, 5
### bind = $mainMod, 6, workspace, 6
### bind = $mainMod, 7, workspace, 7
### bind = $mainMod, 8, workspace, 8
### bind = $mainMod, 9, workspace, 9
### bind = $mainMod, 0, workspace, 10
### 
### # Move active window to a workspace with mainMod + SHIFT + [0-9]
### bind = $mainMod SHIFT, 1, movetoworkspace, 1
### bind = $mainMod SHIFT, 2, movetoworkspace, 2
### bind = $mainMod SHIFT, 3, movetoworkspace, 3
### bind = $mainMod SHIFT, 4, movetoworkspace, 4
### bind = $mainMod SHIFT, 5, movetoworkspace, 5
### bind = $mainMod SHIFT, 6, movetoworkspace, 6
### bind = $mainMod SHIFT, 7, movetoworkspace, 7
### bind = $mainMod SHIFT, 8, movetoworkspace, 8
### bind = $mainMod SHIFT, 9, movetoworkspace, 9
### bind = $mainMod SHIFT, 0, movetoworkspace, 10
### 
### # Example special workspace (scratchpad)
### bind = $mainMod, S, togglespecialworkspace, magic
### bind = $mainMod SHIFT, S, movetoworkspace, special:magic
### 
### # Scroll through existing workspaces with mainMod + scroll
### bind = $mainMod, mouse_down, workspace, e+1
### bind = $mainMod, mouse_up, workspace, e-1
### 
### # Move/resize windows with mainMod + LMB/RMB and dragging
### bindm = $mainMod, mouse:272, movewindow
### bindm = $mainMod, mouse:273, resizewindow
### 
### # Laptop multimedia keys for volume and LCD brightness
### bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
### bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
### bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
### bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
### bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
### bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-

##############################
### 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)$

# Firefox
windowrulev2 = float, class:(LibreWolf), title:(Picture-in-Picture)
windowrulev2 = size 320 180, move 0 0, title:(Picture-in-Picture)

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