2022-08-04 12:53:06 -06:00
|
|
|
{pkgs, config, lib, ... }:
|
|
|
|
|
|
|
|
with config.lib.stylix.colors.withHashtag;
|
|
|
|
with config.stylix.fonts;
|
|
|
|
{
|
|
|
|
options.stylix.targets.bemenu = {
|
|
|
|
enable = config.lib.stylix.mkEnableTarget "bemenu" true;
|
2023-03-29 00:54:14 +01:00
|
|
|
|
2022-08-10 12:44:58 -06:00
|
|
|
fontSize = lib.mkOption {
|
2023-03-29 00:54:14 +01:00
|
|
|
description = lib.mdDoc ''
|
|
|
|
Font size used for bemenu.
|
|
|
|
'';
|
2022-08-10 12:44:58 -06:00
|
|
|
type = with lib.types; nullOr int;
|
2023-03-19 19:39:32 +01:00
|
|
|
default = sizes.popups;
|
2022-08-10 12:44:58 -06:00
|
|
|
}; # optional argument
|
2023-03-29 00:54:14 +01:00
|
|
|
|
|
|
|
alternate = lib.mkOption {
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Whether to use alternating colours.
|
|
|
|
'';
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2022-08-04 12:53:06 -06:00
|
|
|
};
|
|
|
|
|
2023-01-30 22:56:57 +01:00
|
|
|
config = lib.mkIf config.stylix.targets.bemenu.enable {
|
2022-08-04 12:53:06 -06:00
|
|
|
home.sessionVariables.BEMENU_OPTS = with config.stylix.targets.bemenu; builtins.concatStringsSep " " [
|
|
|
|
# Inspired from https://git.sr.ht/~h4n1/base16-bemenu_opts
|
|
|
|
"--tb '${base01}'"
|
|
|
|
"--nb '${base01}'"
|
|
|
|
"--fb '${base01}'"
|
|
|
|
"--hb '${base03}'"
|
|
|
|
"--sb '${base03}'"
|
|
|
|
"--hf '${base0A}'"
|
|
|
|
"--sf '${base0B}'"
|
|
|
|
"--tf '${base05}'"
|
|
|
|
"--ff '${base05}'"
|
|
|
|
"--nf '${base05}'"
|
|
|
|
"--scb '${base01}'"
|
|
|
|
"--scf '${base03}'"
|
|
|
|
"--ab '${if alternate then base00 else base01}'"
|
|
|
|
"--af '${if alternate then base04 else base05}'"
|
2022-08-10 12:44:58 -06:00
|
|
|
"--fn '${sansSerif.name} ${lib.optionalString (fontSize != null) (builtins.toString fontSize)}'"
|
2022-08-04 12:53:06 -06:00
|
|
|
];
|
2023-01-30 22:56:57 +01:00
|
|
|
};
|
2022-08-04 12:53:06 -06:00
|
|
|
}
|