{
  lib,
  config,
  ...
}: let
  inherit (lib) mkIf;
  cfg = config.horseman.wm.hyprland;
in {
  config = mkIf cfg.enable {
    horseman.wm.hyprland.config.keybindings = {
      submaps = [
        {
          name = "disable-all";
          enterBind = {
            flags = ["o"];
            mods = ["SUPER"];
            key = "ESCAPE";
          };
          exitBind = {
            flags = ["o"];
            mods = ["SUPER"];
            key = "ESCAPE";
          };

          binds = [];
        }
      ];

      binds = [
        {
          flags = [];
          mods = ["SUPER"];
          key = "SPACE";
          dispatcher = "exec";
          params = "pkill wofi || wofi -i -S drun -M multi-contains";
        }

        {
          flags = [];
          mods = ["SUPER"];
          key = "RETURN";
          dispatcher = "exec";
          params = "kitty";
        }

        {
          flags = [];
          mods = ["SUPER"];
          key = "Q";
          dispatcher = "killactive";
          params = "";
        }

        {
          flags = [];
          mods = [];
          key = "F11";
          dispatcher = "fullscreen";
          params = "";
        }
        {
          flags = ["o"];
          mods = ["SUPER"];
          key = "L";
          dispatcher = "exec";
          params = "hyprlock";
        }
        {
          flags = ["e"];
          mods = ["SUPER"];
          key = "TAB";
          dispatcher = "changegroupactive";
          params = "f";
        }

        {
          flags = ["e"];
          mods = ["SUPER" "SHIFT"];
          key = "TAB";
          dispatcher = "changegroupactive";
          params = "b";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "F";
          dispatcher = "togglefloating";
          params = "";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "T";
          dispatcher = "togglegroup";
          params = "";
        }

        {
          flags = [];
          mods = ["SUPER"];
          key = "P";
          dispatcher = "pin";
          params = "";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "S";
          dispatcher = "exec";
          params = "hyprshot -m region --clipboard-only";
        }

        {
          flags = [];
          mods = ["SUPER"];
          key = "H";
          dispatcher = "movefocus";
          params = "l";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "L";
          dispatcher = "movefocus";
          params = "r";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "K";
          dispatcher = "movefocus";
          params = "u";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "J";
          dispatcher = "movefocus";
          params = "d";
        }

        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "H";
          dispatcher = "movewindow";
          params = "l";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "L";
          dispatcher = "movewindow";
          params = "r";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "K";
          dispatcher = "movewindow";
          params = "u";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "J";
          dispatcher = "movewindow";
          params = "d";
        }

        {
          flags = ["e"];
          mods = ["SUPER"];
          key = "Left";
          dispatcher = "moveactive";
          params = "-50 0";
        }
        {
          flags = ["e"];
          mods = ["SUPER"];
          key = "Right";
          dispatcher = "moveactive";
          params = "50 0";
        }
        {
          flags = ["e"];
          mods = ["SUPER"];
          key = "Up";
          dispatcher = "moveactive";
          params = "0 -50";
        }
        {
          flags = ["e"];
          mods = ["SUPER"];
          key = "Down";
          dispatcher = "moveactive";
          params = "0 50";
        }

        {
          flags = ["e"];
          mods = ["SUPER" "SHIFT"];
          key = "Left";
          dispatcher = "resizeactive";
          params = "-50 0";
        }
        {
          flags = ["e"];
          mods = ["SUPER" "SHIFT"];
          key = "Right";
          dispatcher = "resizeactive";
          params = "50 0";
        }
        {
          flags = ["e"];
          mods = ["SUPER" "SHIFT"];
          key = "Up";
          dispatcher = "resizeactive";
          params = "0 -50";
        }
        {
          flags = ["e"];
          mods = ["SUPER" "SHIFT"];
          key = "Down";
          dispatcher = "resizeactive";
          params = "0 50";
        }

        {
          flags = [];
          mods = ["SUPER"];
          key = "1";
          dispatcher = "workspace";
          params = "1";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "2";
          dispatcher = "workspace";
          params = "2";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "3";
          dispatcher = "workspace";
          params = "3";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "4";
          dispatcher = "workspace";
          params = "4";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "5";
          dispatcher = "workspace";
          params = "5";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "6";
          dispatcher = "workspace";
          params = "6";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "7";
          dispatcher = "workspace";
          params = "7";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "8";
          dispatcher = "workspace";
          params = "8";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "9";
          dispatcher = "workspace";
          params = "9";
        }
        {
          flags = [];
          mods = ["SUPER"];
          key = "0";
          dispatcher = "workspace";
          params = "10";
        }

        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "1";
          dispatcher = "movetoworkspace";
          params = "1";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "2";
          dispatcher = "movetoworkspace";
          params = "2";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "3";
          dispatcher = "movetoworkspace";
          params = "3";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "4";
          dispatcher = "movetoworkspace";
          params = "4";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "5";
          dispatcher = "movetoworkspace";
          params = "5";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "6";
          dispatcher = "movetoworkspace";
          params = "6";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "7";
          dispatcher = "movetoworkspace";
          params = "7";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "8";
          dispatcher = "movetoworkspace";
          params = "8";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "9";
          dispatcher = "movetoworkspace";
          params = "9";
        }
        {
          flags = [];
          mods = ["SUPER" "SHIFT"];
          key = "0";
          dispatcher = "movetoworkspace";
          params = "10";
        }

        {
          flags = ["e"];
          mods = ["SUPER" "CONTROL"];
          key = "Right";
          dispatcher = "workspace";
          params = "e+1";
        }
        {
          flags = ["e"];
          mods = ["SUPER" "CONTROL"];
          key = "Left";
          dispatcher = "workspace";
          params = "e-1";
        }

        {
          flags = ["m"];
          mods = ["SUPER"];
          key = "mouse:272";
          dispatcher = "movewindow";
          params = "";
        }
        {
          flags = ["m"];
          mods = ["SUPER" "SHIFT"];
          key = "mouse:272";
          dispatcher = "resizewindow";
          params = "";
        }

        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86AudioRaiseVolume";
          dispatcher = "exec";
          params = "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+";
        }
        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86AudioLowerVolume";
          dispatcher = "exec";
          params = "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%-";
        }
        {
          flags = ["e" "l"];
          mods = ["SHIFT"];
          key = "XF86AudioRaiseVolume";
          dispatcher = "exec";
          params = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+";
        }
        {
          flags = ["e" "l"];
          mods = ["SHIFT"];
          key = "XF86AudioLowerVolume";
          dispatcher = "exec";
          params = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-";
        }
        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86AudioMute";
          dispatcher = "exec";
          params = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
        }
        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86AudioMicMute";
          dispatcher = "exec";
          params = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
        }
        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86MonBrightnessUp";
          dispatcher = "exec";
          params = "brightnessctl s 10%+";
        }
        {
          flags = ["e" "l"];
          mods = [];
          key = "XF86MonBrightnessDown";
          dispatcher = "exec";
          params = "brightnessctl s 10%-";
        }
        {
          flags = ["l"];
          mods = [];
          key = "XF86AudioNext";
          dispatcher = "exec";
          params = "playerctl next";
        }
        {
          flags = ["l"];
          mods = [];
          key = "XF86AudioPause";
          dispatcher = "exec";
          params = "playerctl play-pause";
        }
        {
          flags = ["l"];
          mods = [];
          key = "XF86AudioPlay";
          dispatcher = "exec";
          params = "playerctl play-pause";
        }
        {
          flags = ["l"];
          mods = [];
          key = "XF86AudioPrev";
          dispatcher = "exec";
          params = "playerctl previous";
        }
      ];
    };
  };
}
