btop: use mkTarget
This commit is contained in:
parent
81cb57a350
commit
910dc0dc3e
1 changed files with 23 additions and 16 deletions
|
|
@ -1,22 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.stylix.targets.btop.enable =
|
||||
config.lib.stylix.mkEnableTarget "btop" true;
|
||||
mkTarget,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
mkTarget {
|
||||
name = "btop";
|
||||
humanName = "btop";
|
||||
|
||||
config =
|
||||
lib.mkIf
|
||||
(
|
||||
config.stylix.enable
|
||||
&& config.stylix.targets.btop.enable
|
||||
&& config.programs.btop.enable
|
||||
)
|
||||
configElements = [
|
||||
(
|
||||
{ opacity }:
|
||||
{
|
||||
programs.btop.settings.theme_background = lib.mkIf (
|
||||
opacity.terminal != 1.0
|
||||
) false;
|
||||
}
|
||||
)
|
||||
(
|
||||
{ colors }:
|
||||
{
|
||||
programs.btop = {
|
||||
settings = {
|
||||
color_theme = "stylix";
|
||||
theme_background = lib.mkIf (config.stylix.opacity.terminal != 1.0) false;
|
||||
};
|
||||
themes.stylix = with config.lib.stylix.colors.withHashtag; ''
|
||||
settings.color_theme = "stylix";
|
||||
themes.stylix = with colors.withHashtag; ''
|
||||
#Generated by Stylix
|
||||
theme[main_bg]="${base00}"
|
||||
theme[main_fg]="${base05}"
|
||||
|
|
@ -62,5 +67,7 @@
|
|||
theme[process_end]="${base08}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue