{ hyprland, ... }:
{
  imports = [
    hyprland.homeManagerModules.default
    ./hyprpaper.nix
    ./hyprlock.nix
    ./hyprgrass.nix
    #    ./utils.nix
  ];

  wayland.windowManager.hyprland = {
    enable = true;
    # package = hyprland.packages.${pkgs.system}.hyprland;

    xwayland.enable = true;

    systemd.enable = true;

    settings = {
      "$terminal" = "alacritty";

      env = [ "HYPRCURSOR_THEME,rose-pine-hyprcursor" ];

      xwayland.force_zero_scaling = true;

      monitor = [ ",preferred,1" ];

      ecosystem = {
        "no_update_news" = true;
        "no_donation_nag" = true;
      };

      exec-once = [
        "hyprlock"
        "ags"
      ];

      exec = [ "[workspace special:keepass silent] keepassxc" ];

      windowrule = [
        "workspace special:keepass,class:org.keepassxc.KeePassXC,title:^(.*)(KeePassXC)(.*)$"
        "workspace unset,class:org.keepassxc.KeePassXC,title:Unlock Database - KeePassXC"
        "noanim, class:^ueberzugpp_(.*)$"
      ];

      workspace = [
        "special:keepass,gapsout:45"
        "special:magic,gapsout:45"
      ];

      input = {
        kb_layout = "de";

        follow_mouse = 1;

        touchpad.natural_scroll = true;

        sensitivity = 0;

        kb_options = "compose:caps";
      };

      general = {
        gaps_in = 10;
        gaps_out = 15;
        border_size = 2;

        layout = "dwindle";

        allow_tearing = false;
      };

      decoration = {
        rounding = 10;

        blur = {
          enabled = true;
          size = 2;
          passes = 1;
        };

        shadow = {
          enabled = true;
          range = 4;
          render_power = 3;
        };
      };

      animations = {
        enabled = true;

        bezier = "myBezier, 0.0, 0.8, 0.2, 1.0";

        animation = [
          "windows, 1, 5, myBezier"
          "windowsOut, 1, 5, default, popin 80%"
          "border, 1, 10, default"
          "borderangle, 1, 8, default"
          "fade, 1, 7, default"
          "workspaces, 1, 5, myBezier"
          "specialWorkspace, 1, 5, myBezier, slidefadevert"
        ];
      };

      dwindle = {
        pseudotile = true;
        smart_split = true;
        preserve_split = true;
      };

      master = {
        new_status = "master";
        new_on_top = 1;
      };

      "$mainMod" = "SUPER";

      bind = [
        "$mainMod, Q, exec, $terminal"
        "$mainMod, W, exec, $terminal -e yazi"
        "$mainMod, C, killactive,"
        "$mainMod, backspace, exec, hyprlock"
        "$mainMod, R, exec, rofi -show drun"

        "$mainMod, A, togglefloating,"
        "$mainMod, S, togglesplit,"
        "$mainMod, D, pseudo,"
        "$mainMod, F, fullscreen,"

        "$mainMod, P, togglespecialworkspace, keepass"
        "$mainMod, P, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi"

        ", print, exec, hyprshot -m region -o /home/lilith/sync/screenshots -z"
        "CTRL, print, exec, hyprshot -m output -o /home/lilith/sync/screenshots -z"

        "$mainMod, H, movefocus, l"
        "$mainMod, L, movefocus, r"
        "$mainMod, K, movefocus, u"
        "$mainMod, J, movefocus, d"

        "$mainMod, 1, workspace, 1"
        "$mainMod, 2, workspace, 2"
        "$mainMod, 3, workspace, 3"
        "$mainMod, 4, workspace, 4"
        "$mainMod, 5, workspace, 5"
        "$mainMod, 6, workspace, 6"
        "$mainMod, 7, workspace, 7"
        "$mainMod, 8, workspace, 8"
        "$mainMod, 9, workspace, 9"
        "$mainMod, 0, workspace, 10"

        "$mainMod SHIFT, 1, movetoworkspace, 1"
        "$mainMod SHIFT, 2, movetoworkspace, 2"
        "$mainMod SHIFT, 3, movetoworkspace, 3"
        "$mainMod SHIFT, 4, movetoworkspace, 4"
        "$mainMod SHIFT, 5, movetoworkspace, 5"
        "$mainMod SHIFT, 6, movetoworkspace, 6"
        "$mainMod SHIFT, 7, movetoworkspace, 7"
        "$mainMod SHIFT, 8, movetoworkspace, 8"
        "$mainMod SHIFT, 9, movetoworkspace, 9"
        "$mainMod SHIFT, 0, movetoworkspace, 10"

        "$mainMod, I, togglespecialworkspace, magic"
        "$mainMod SHIFT, I, movetoworkspace, special:magic"
      ];

      bindm = [
        "$mainMod, mouse:272, movewindow"
        "$mainMod, mouse:273, resizewindow"
      ];

      binde = [
        ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
        ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"
        ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
        ", XF86PowerOff, exec, systemctl poweroff"
      ];
    };
  };
}
