{
  lib,
  config,
  ...
}: let
  inherit (lib) mkIf mkEnableOption catppuccin;
  cfg = config.horseman.dots.waybar;
  username = config.horseman.username;
  colors = config.horseman.catppuccin.colors;
in {
  options = {
    horseman.dots.waybar = {
      enable = mkEnableOption "~/.config/waybar/style.css";
    };
  };

  config = mkIf cfg.enable {
    home-manager.users.${username}.xdg.configFile."waybar/style.css".text = ''
      #waybar {
        background: transparent;
      }

      * {
        font-family: "CaskaydiaCove Nerd Font";
      }

      .modules-left, .modules-center, .modules-right {
        border: 2px solid ${catppuccin.toHex colors.accent};
        border-radius: 10px;
        margin: 5px;
        background: ${catppuccin.toHex colors.base};
        color: ${catppuccin.toHex colors.text};
      }

      #power {
        padding-left: 10px;
      }
      #idle_inhibitor.activated {
        color: ${catppuccin.toHex colors.red};
      }
      #power * {
        color: ${catppuccin.toHex colors.accent};
        transition: 0.2s color ease;
        font-size: 26px;
      }
      #power *:hover {
        color: ${catppuccin.toHex colors.red};
      }

      #workspaces .empty {
        color: ${catppuccin.toHex colors.surface0};
      }
      #workspaces .active {
        color: ${catppuccin.toHex colors.red};
        font-size: 18px;
      }
      #workspaces * {
        padding: 0px 2px;
        margin: 0px;
        border: 0px solid black;
      }

      #workspaces > * {
        color: ${catppuccin.toHex colors.accent};
      }


      #clock {
        color: ${catppuccin.toHex colors.peach};
      }
      #battery {
        color: ${catppuccin.toHex colors.maroon};
      }
      #cpu {
        color: ${catppuccin.toHex colors.red};
      }
      #memory {
        color: ${catppuccin.toHex colors.mauve};
      }
      #pulseaudio {
        color: ${catppuccin.toHex colors.blue};
      }
      #network {
        color: ${catppuccin.toHex colors.teal};
      }
      .horizontal .modules-right {
        font-size: 16px;
      }
      .horizontal .modules-right * {
        padding: 0px 8px;
      }
      .vertical .modules-right {
        font-size: 16px;
        padding: 0px 8px;
      }
      .vertical .modules-right * {
        padding: 2px 0px;
      }
    '';
  };
}
