{
  lib,
  config,
  ...
}: let
  inherit (lib) mkIf mkEnableOption;
  cfg = config.horseman.dots.gtk;
  username = config.horseman.username;

  catppuccin = config.horseman.catppuccin;
in {
  options = {
    horseman.dots.gtk = {
      enable = mkEnableOption "~/.config/gtk-4.0/settings.ini";
    };
  };

  config = let
    settings = ''
      [Settings]
      gtk-theme-name=Adwaita
      gtk-icon-theme-name=Adwaita
      gtk-font-name=Adwaita Sans 11
      gtk-cursor-theme-name=catppuccin-${catppuccin.flavor}-dark-cursors
      gtk-cursor-theme-size=24
      gtk-application-prefer-dark-theme=0
    '';
  in
    mkIf cfg.enable {
      home-manager.users.${username}.home.file = {
        ".config/gtk-4.0/settings.ini".text = settings;
        ".config/gtk-3.0/settings.ini".text = settings;
      };
    };
}
