i3status-rust: apply background opacity (#1450)

Link: https://github.com/nix-community/stylix/pull/1450

Reviewed-by: pancho horrillo <pancho@pancho.name>
Reviewed-by: Daniel Thwaites <danth@danth.me>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Shahar "Dawn" Or 2025-06-08 23:01:38 +07:00 committed by GitHub
parent b3e8f15fe3
commit 5869510e48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 16 deletions

View file

@ -1,19 +1,28 @@
{ config, ... }:
{ lib, config, ... }:
let
opacityHex = lib.toHexString (
builtins.ceil (config.stylix.opacity.desktop * 255)
);
in
{
# Merge this with your bar's theme's overrides with //config.lib.stylix.i3status-rust.bar
config.lib.stylix.i3status-rust.bar =
with config.lib.stylix.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;
};
lib.mapAttrs (n: v: if lib.hasSuffix "_bg" n then v + opacityHex else v)
(
with config.lib.stylix.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;
}
);
}

View file

@ -1,5 +1,6 @@
{ lib, ... }:
{
name = "i3status-rust";
homepage = "https://github.com/greshake/i3status-rust";
maintainers = [ ];
maintainers = [ lib.maintainers.mightyiam ];
}