-
-
Notifications
You must be signed in to change notification settings - Fork 262
i3status-rust: use mkTarget #1794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
5c5b45d
to
860f1ff
Compare
1456c9f
to
1201618
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
1201618
to
40eaa81
Compare
made the color part work when opacity is null |
40eaa81
to
0f3f91f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but hard to say whether this truly works without any testing.
Sorry. It's on my list. |
I took a moment to try and got this:
Perhaps the way in which I am currently applying the provided style would help: |
0f3f91f
to
b5f61a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be like this. I'm going to paste the entire file here.:
{ mkTarget, lib, ... }:
let
themeOverrides =
{ cfg, colors }:
lib.mapAttrs (n: v: if lib.hasSuffix "_bg" n then v + cfg.bgOpacity else v) (
with colors.withHashtag;
{
idle_bg = base00;
idle_fg = base05;
info_bg = base09;
info_fg = base00;
good_bg = base01;
good_fg = base05;
warning_bg = base0A;
warning_fg = base00;
critical_bg = base08;
critical_fg = base00;
separator_bg = base00;
separator_fg = base05;
}
);
in
mkTarget {
name = "i3status-rust";
humanName = "i3status-rust";
extraOptions = {
barNames = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
description = "i3status-rust bars to apply theming to.";
example = [ "default" ];
};
bgOpacity = lib.mkOption {
type = lib.types.float;
default = 1.0;
internal = true;
apply = v: lib.toHexString (builtins.ceil (v * 255));
};
};
imports = lib.singleton (
{ config, ... }:
{
lib.stylix.i3status-rust.bar =
lib.warn
"stylix: `config.lib.stylix.i3status-rust.bar` has been replace with `config.stylix.targets.i3status-rust.barNames` and will be removed after 26.11."
(themeOverrides {
cfg = config.stylix.targets.i3status-rust;
inherit (config.lib.stylix) colors;
});
}
);
configElements = [
(
{ opacity }:
{
stylix.targets.i3status-rust.bgOpacity = opacity.desktop;
}
)
(
{ cfg, colors }:
{
programs.i3status-rust.bars = lib.genAttrs cfg.barNames (_: {
settings.theme.overrides = themeOverrides { inherit cfg colors; };
});
}
)
];
}
With the contents of the file I pasted above, I have tested both the |
@awwpotato what is the status of this PR? |
Submission Checklist
Notify Maintainers
@mightyiam