mirror of
https://github.com/danth/stylix
synced 2024-11-26 22:20:22 +00:00
423c819d77
HM just added a new bemenu module upstream, so this commit changes the stylix bemenu module to use that instead. Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
51 lines
1.6 KiB
Nix
51 lines
1.6 KiB
Nix
{pkgs, config, lib, ... }:
|
|
|
|
with config.lib.stylix.colors.withHashtag;
|
|
with config.stylix.fonts;
|
|
let
|
|
bemenuOpacity = lib.toHexString ((((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100));
|
|
in {
|
|
options.stylix.targets.bemenu = {
|
|
enable = config.lib.stylix.mkEnableTarget "bemenu" true;
|
|
|
|
fontSize = lib.mkOption {
|
|
description = lib.mdDoc ''
|
|
Font size used for bemenu.
|
|
'';
|
|
type = with lib.types; nullOr int;
|
|
default = sizes.popups;
|
|
}; # optional argument
|
|
|
|
alternate = lib.mkOption {
|
|
description = lib.mdDoc ''
|
|
Whether to use alternating colours.
|
|
'';
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.stylix.targets.bemenu.enable {
|
|
programs.bemenu.settings = with config.stylix.targets.bemenu; {
|
|
tb = "${base01}${bemenuOpacity}"; # Title bg
|
|
nb = "${base01}${bemenuOpacity}"; # Normal bg
|
|
fb = "${base01}${bemenuOpacity}"; # Filter bg
|
|
hb = "${base03}${bemenuOpacity}"; # Highlighted bg
|
|
sb = "${base03}${bemenuOpacity}"; # Selected bg
|
|
scb = "${base01}"; # Scrollbar bg
|
|
|
|
hf = "${base0A}"; # Highlighted fg
|
|
sf = "${base0B}"; # Selected fg
|
|
tf = "${base05}"; # Title fg
|
|
ff = "${base05}"; # Filter fg
|
|
nf = "${base05}"; # Normal fg
|
|
scf = "${base03}"; # Scrollbar fg
|
|
|
|
ab = "${if alternate then base00 else base01}"; # Alternate bg
|
|
af = "${if alternate then base04 else base05}"; # Alternate fg
|
|
|
|
# Font name
|
|
fn = "${sansSerif.name} ${lib.optionalString (fontSize != null) (builtins.toString fontSize)}";
|
|
};
|
|
};
|
|
}
|