{ config, lib, ... }:

let
  cfg = config.utils;
in
{
  imports = [ ./subs/sxhkd.nix ];

  options.utils = {
    rofi.enable = lib.mkOption {
      default = true;
      type = lib.types.bool;
    };
    sxhkd.enable = lib.mkOption {
      default = true;
      type = lib.types.bool;
    };
    flameshot.enable = lib.mkOption {
      default = true;
      type = lib.types.bool;
    };
    mako.enable = lib.mkOption {
      default = false;
      type = lib.types.bool;
    };
  };

  config = {
    programs.rofi.enable = cfg.rofi.enable;

    subs.sxhkd.enable = cfg.sxhkd.enable;

    services.flameshot = {
      enable = cfg.flameshot.enable;
      settings = {
        General = {
          savePathFixed = false;
          saveAfterCopy = true;
          showStartupLaunchMessage = false;
          useJpgForClipboard = true;
        };
      };
    };

    services.mako = {
      enable = cfg.mako.enable;
      settings = {
        sort = "-time";
        layer = "overlay";
        background-color = "#1E1E1E";
        border-color = "#838383";
        border-size = 1;
        border-radius = 5;
        max-icon-size = 64;
        padding = 10;
        font = "Inter 10";
        default-timeout = 5000;
        "urgency=high" = {
          background-color = "#EF5350";
          border-color = "#22DA6E";
          default-timeout = 0;
        };
      };
    };
  };
}
