Initial bemenu module

This commit is contained in:
Lyndon Sanche 2022-08-04 12:53:06 -06:00
parent b4840cfc60
commit 30757d4b2d
No known key found for this signature in database
GPG key ID: 6F8E82F60C799B18
2 changed files with 35 additions and 0 deletions

View file

@ -56,6 +56,7 @@
nixosModules.stylix = { pkgs, ... }@args: {
imports = [
./modules/alacritty.nix
./modules/bemenu.nix
./modules/console.nix
./modules/dunst.nix
./modules/feh.nix

34
modules/bemenu.nix Normal file
View file

@ -0,0 +1,34 @@
{pkgs, config, lib, ... }:
with config.lib.stylix.colors.withHashtag;
with config.stylix.fonts;
{
options.stylix.targets.bemenu = {
enable = config.lib.stylix.mkEnableTarget "bemenu" true;
fontSize = lib.mkOption { type = lib.types.str; default = ""; }; # optional argument
alternate = lib.mkOption { type = lib.types.bool; default = false; };
};
config.home-manager.sharedModules = lib.mkIf config.stylix.targets.mako.enable [{
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}'"
# Alternating colours, currently set to match primary. Adding a module option to enable or disable alternating in Stylix could be useful
"--ab '${if alternate then base00 else base01}'"
"--af '${if alternate then base04 else base05}'"
"--fn '${sansSerif.name} ${fontSize}'"
];
}];
}