{pkgs, ...}: {
  imports = [
    ./dependencies.nix
  ];

  xdg.portal.enable = true;
  xdg.portal.config = {
    common = {
      default = ["kde"];
    };
  };
  xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk];

  home.sessionVariables = {
    WLR_NO_HARDWARE_CURSORS = "1";
    NIXOS_OZONE_WL = "1";
  };

  wayland.windowManager.hyprland = {
    enable = true;

    settings = {
      monitor = [
        "HDMI-A-1,highrr,0x0,1"
        ",preferred,auto,1,mirror,eDP-1"
      ];

      input = {
        "kb_layout" = "us, cz";
        "kb_options" = "grp:caps_toggle";
        "follow_mouse" = "1";

        #"kb_options" = "caps:swapecase";
        #"kb_options" = "ctrl:nocaps";

        touchpad = {
          "natural_scroll" = "no";
        };

        "sensitivity" = "0";
        "force_no_accel" = "1";
        #"numlock_by_default" = "true";
      };

      gestures = {
        "workspace_swipe" = "true";
        "workspace_swipe_fingers" = "3";
      };

      dwindle = {
        "pseudotile" = "yes";
        "preserve_split" = "yes";
      };

      master = {
        "new_status" = "master";
      };

      misc = {
        "vrr" = "0";
        "disable_splash_rendering" = "true";
        "force_default_wallpaper" = "0";
      };

      xwayland = {
        "force_zero_scaling" = "true";
      };

      env = [
        "XDG_CURRENT_DESKTOP,Hyprland"
        "XDG_SESSION_TYPE,wayland"
        "XDG_SESSION_DESKTOP,Hyprland"
        "QT_QPA_PLATFORM,wayland;xcb"
        #"QT_QPA_PLATFORMTHEME,qt6ct"
        "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
        "QT_AUTO_SCREEN_SCALE_FACTOR,1"
        "MOZ_ENABLE_WAYLAND,1"
        "GDK_SCALE,1"
      ];

      exec-once = [
        "sleep 5 && rog-control-center"
        "discord --start-minimized"
        "vesktop --start-minimized"
        "${pkgs.kdePackages.kdeconnect-kde}/bin/kdeconnect-indicator"

        "systemctl --user start hyprpolkitagent"
        #"swww-daemon --format xrgb"
        #"swww ../../aurora_borealis.png"
        "hypridle"
        "waybar"
        "swayosd-server"

        "blueman-applet"
        "udiskie --no-automount --smart-tray"
        "nm-applet --indicator"
        "dunst"
        "wl-paste --type text --watch cliphist store # clipboard store text data"
        "wl-paste --type image --watch cliphist store # clipboard store image data"
        #"$scrPath/batterynotify.sh # battery notification"

        #"$scrPath/resetxdgportal.sh # reset XDPH for screenshare"
        #"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH"
        #"dbus-update-activation-environment --systemd --all # for XDPH"
        #"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH"
      ];

      "$mod" = "SUPER";
      "$term" = "${pkgs.kitty}/bin/kitty";
      "$editor" = "${pkgs.netbeans}/bin/netbeans";
      "$file" = "${pkgs.nautilus}/bin/nautilus";
      "$browser" = "${pkgs.firefox}/bin/firefox";
      "$rofi" = "${pkgs.rofi-wayland}/bin/rofi";
      #"$dontkillsteam" = "${pkgs.dontkillsteam}/bin/dontkillsteam";

      animations = {
        "enabled" = "yes";
        "bezier" = [
          "wind, 0.05, 0.9, 0.1, 1.05"
          "winIn, 0.1, 1.1, 0.1, 1.1"
          "winOut, 0.3, -0.3, 0, 1"
          "liner, 1, 1, 1, 1"
        ];
        "animation" = [
          "windows, 1, 6, wind, slide"
          "windowsIn, 1, 6, winIn, slide"
          "windowsOut, 1, 5, winOut, slide"
          "windowsMove, 1, 5, wind, slide"
          "border, 1, 1, liner"
          "borderangle, 1, 30, liner, loop"
          "fade, 1, 10, default"
          "workspaces, 1, 5, wind"
        ];
      };

      bindr = [
        "ALTSHIFT, Shift_L, exec, keyboardswitch"
        "CAPS,Caps_Lock, exec, swayosd-client --caps-lock"
      ];

      #bindsr = [
      #];

      bindd = [
        "$mod SHIFT, P, Color Picker, exec, hyprpicker -a"
        "$mod SHIFT, R, Random Background, exec, background-switch-random"
      ];

      bindl = [
        # Audio
        ",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
        ",XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"

        # Media
        "Alt, P, exec, playerctl play-pause"
        "Alt, I, exec, playerctl next"
        "Alt, O, exec, playerctl previous"
      ];

      bindel = [
        ",XF86AudioLowerVolume, exec, swayosd-client --output-volume -5"
        ",XF86AudioRaiseVolume, exec, swayosd-client --output-volume 5"
        # Brightness
        ",XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
        ",XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
      ];

      binde = [
        # Resize windows
        "$mod+Shift, Right, resizeactive, 30 0"
        "$mod+Shift, Left, resizeactive, -30 0"
        "$mod+Shift, Up, resizeactive, 0 -30"
        "$mod+Shift, Down, resizeactive, 0 30"
      ];

      bindm = [
        # Move/Resize focused window
        "$mod, mouse:272, movewindow"
        "$mod, mouse:273, resizewindow"
        "$mod, Z, movewindow"
        "$mod, X, resizewindow"
      ];

      bind = [
        "$mod, Q, exec, ~/.nix-profile/bin/dontkillsteam"
        "$mod, Delete, exit"
        "$mod, W, togglefloating"
        "$mod, G, togglegroup"
        "Alt, Return, fullscreen"
        "$mod, Escape, exec, hyprlock"
        #"$mod+Shift,F, exec, windowpin.sh"
        "$mod, Backspace, exec, wlogout -b 2"
        "$Ctrl+Alt, W, exec, killall waybar || waybar" # toggle waybar
        "$mod, N, exec, $term -e ani-cli"
        "$mod, T, exec, $term"
        "$mod, F, exec, $browser"
        "$mod, E, exec, $file"
        "$mod, C, exec, $editor"
        "Ctrl+Shift, Escape, exec, btop"

        # Rofi
        "$mod, A, exec, pkill -x $rofi || $rofi -show drun"
        "$mod, Tab, exec, pkill -x $rofi || $rofi -show window"
        "$mod+Shift, E, exec, pkill -x $rofi || $rofi -show emoji"

        # Grouped Windows
        "$mod CTRL, H, changegroupactive, b"
        "$mod CTRL, L, changegroupactive, f"

        # Screenshot
        "$mod, P, exec, screenshot s"
        "$mod+Ctrl, P, exec, screenshot sf"
        "$mod+Alt, P, exec, screenshot m"
        ", Print, exec, screenshot p" # All monitors screenshot capture

        # Custom scripts
        "$mod, V, exec, pkill -x $rofi || scliphist c"

        # Move/Change window focus
        "$mod, H, movefocus, l"
        "$mod, L, movefocus, r"
        "$mod, K, movefocus, u"
        "$mod, J, movefocus, d"
        "Alt, Tab, movefocus, d"

        "$mod Shift, H, movewindow, l"
        "$mod Shift, L, movewindow, r"
        "$mod Shift, K, movewindow, u"
        "$mod Shift, J, movewindow, d"

        "$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"

        "$mod+Ctrl, Right, workspace, r+1"
        "$mod+Ctrl, Left, workspace, r-1"

        "$mod+Ctrl, Down, workspace, empty"

        # Move focused window to a relative 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"

        # Move focused window to a relative workspace silently
        "$mod+Alt, 1, movetoworkspacesilent, 1"
        "$mod+Alt, 2, movetoworkspacesilent, 2"
        "$mod+Alt, 3, movetoworkspacesilent, 3"
        "$mod+Alt, 4, movetoworkspacesilent, 4"
        "$mod+Alt, 5, movetoworkspacesilent, 5"
        "$mod+Alt, 6, movetoworkspacesilent, 6"
        "$mod+Alt, 7, movetoworkspacesilent, 7"
        "$mod+Alt, 8, movetoworkspacesilent, 8"
        "$mod+Alt, 9, movetoworkspacesilent, 9"
        "$mod+Alt, 0, movetoworkspacesilent, 10"

        # Move focused window to a relative workspace
        "$mod+Ctrl+Alt, Right, movetoworkspace, r+1"
        "$mod+Ctrl+Alt, Left, movetoworkspace, r-1"

        # Move active window around current workspace with $mod + SHIFT + CTRL

        # Scroll through existing workspaces
        "$mod, mouse_down, workspace, e+1"
        "$mod, mouse_up, workspace, e-1"

        # Move/Switch to special workspace
        "$mod+Alt, S, movetoworkspacesilent, special"
        "$mod, S, togglespecialworkspace"

        "$mod, U, togglesplit"
      ];

      windowrulev2 = [
      ];

      layerrule = [
        "blur,rofi"
        "ignorezero,rofi"
        "blur,notifications"
        "ignorezero,notifications"
        "blur,swaync-notification-window"
        "ignorezero,swaync-notification-window"
        "blur,swaync-control-center"
        "ignorezero,swaync-control-center"
        "blur,logout_dialog"
      ];
    };
  };
}
