{inputs, pkgs, lib, config, ...}:
let
  cfg = config.nix-config.hypr;
in
{
  config = {
    wayland.windowManager.hyprland = {
      settings = {

        master = {
          # no_gaps_when_only = true;

          # default: single app is centered/fullscreen; when more apps are added it splits
          orientation = "right";
          # keep center-master behaviour when there is exactly 1 slave (i.e. single app appears fullscreen)
          slave_count_for_center_master = 1;
          # only split in two columns
          mfact = 0.6;
          inherit_fullscreen = false;
        };

        # #create special workspaces with no gaps
        # workspace = [
        #   "w[t1], gapsout:0, gapsin:0"
        #   "w[tg1], gapsout:0, gapsin:0"
        #   "f[1], gapsout:0, gapsin:0"
        # ];

        # # automatically assign windows to workspaces when there is only one window
        # windowrulev2 = [
        #   "bordersize 0, floating:0, onworkspace:w[t1]"
        #   "rounding 0, floating:0, onworkspace:w[t1]"
        #   "bordersize 0, floating:0, onworkspace:w[tg1]"
        #   "rounding 0, floating:0, onworkspace:w[tg1]"
        #   "bordersize 0, floating:0, onworkspace:f[1]"
        #   "rounding 0, floating:0, onworkspace:f[1]"
        # ];

        misc = {
          vfr = false;
          disable_hyprland_logo = true;
        };

        # Keybind to toggle between 2 and 3 column master layout
        bind = [
          # Toggle master layout between 2 and 3 columns (press $mod + m)
          "$mod, m, exec, hyprctl dispatch layoutmsg orientationcenter"
          "$mod, m, exec, hyprctl dispatch layoutmsg mfact exact 0.34"

          # Toggle master layout between 3 and 2 columns (press $mod + Shift + m)
          "$mod, Shift+m, exec, hyprctl dispatch layoutmsg orientationright"
          "$mod, Shift+m, exec, hyprctl dispatch layoutmsg mfact exact 0.6"
        ];
      };
    };
  };
}
