# ABOUTME: Hyprland keybindings configuration
# ABOUTME: Defines keyboard and mouse shortcuts for window management

{ config, pkgs, ... }:
{
  wayland.windowManager.hyprland.settings = {
    bind = [
      # Application launchers
      "$mod, Space, exec, $menu"
      "$mod, Return, exec, $terminal"
      "$mod, E, exec, $fileManager"
      "$mod, B, exec, $browser"

      # Window management
      "$mod, W, killactive,"
      "$mod, BackSpace, killactive,"
      "$mod, V, togglefloating,"
      "$mod SHIFT, equal, fullscreen,"
      "$mod, J, togglesplit,"
      "$mod, P, pseudo,"

      # Focus navigation
      "$mod, left, movefocus, l"
      "$mod, right, movefocus, r"
      "$mod, up, movefocus, u"
      "$mod, down, movefocus, d"

      # Workspace switching
      "$mod, 1, workspace, 1"
      "$mod, 2, workspace, 2"
      "$mod, 3, workspace, 3"
      "$mod, 4, workspace, 4"
      "$mod, 5, workspace, 5"
      "$mod, 6, workspace, 6"
      "$mod, 7, workspace, 7"
      "$mod, 8, workspace, 8"
      "$mod, 9, workspace, 9"
      "$mod, 0, workspace, 10"

      # Move window to workspace
      "$mod SHIFT, 1, movetoworkspace, 1"
      "$mod SHIFT, 2, movetoworkspace, 2"
      "$mod SHIFT, 3, movetoworkspace, 3"
      "$mod SHIFT, 4, movetoworkspace, 4"
      "$mod SHIFT, 5, movetoworkspace, 5"
      "$mod SHIFT, 6, movetoworkspace, 6"
      "$mod SHIFT, 7, movetoworkspace, 7"
      "$mod SHIFT, 8, movetoworkspace, 8"
      "$mod SHIFT, 9, movetoworkspace, 9"
      "$mod SHIFT, 0, movetoworkspace, 10"

      # Workspace navigation
      "$mod, comma, workspace, m-1"
      "$mod, period, workspace, m+1"

      # Window resize
      "$mod, minus, splitratio, -0.1"
      "$mod, equal, splitratio, +0.1"

      # Lock screen
      "$mod, Escape, exec, loginctl lock-session"

      # Screenshots
      ", Print, exec, hyprshot -m region"
      "SHIFT, Print, exec, hyprshot -m window"
      "CTRL, Print, exec, hyprshot -m output"

      # Color picker
      "$mod SHIFT, C, exec, hyprpicker -a"

      # Clipboard manager
      "$mod SHIFT, V, exec, ghostty --class=clipse -e clipse"
    ];

    bindm = [
      # Mouse bindings for window management
      "$mod, mouse:272, movewindow"
      "$mod, mouse:273, resizewindow"
    ];

    binde = [
      # Repeatable bindings for media controls
      ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
      ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
      ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"

      # Brightness controls
      ", XF86MonBrightnessUp, exec, brightnessctl s +5%"
      ", XF86MonBrightnessDown, exec, brightnessctl s 5%-"
    ];

    bindl = [
      # Media player controls
      ", XF86AudioNext, exec, playerctl next"
      ", XF86AudioPrev, exec, playerctl previous"
      ", XF86AudioPlay, exec, playerctl play-pause"
    ];
  };
}
