Recursive update

This commit is contained in:
Filippo Berto 2022-06-29 09:34:43 +02:00
parent 8592e99bf3
commit c741cd7201
4 changed files with 51 additions and 46 deletions

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
with lib;
let
inherit (pkgs.rice) colorPalette opacity;
grep = "${pkgs.gnugrep}/bin/grep";
@ -110,7 +111,7 @@ in
screenchange-reload = false;
};
"bar/primary" = commonBar // {
"bar/primary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery date powermenu";
@ -121,7 +122,7 @@ in
};
};
"bar/secondary" = commonBar // {
"bar/secondary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery date powermenu";
@ -147,9 +148,9 @@ in
};
format = {
charging = colors.selected // { text = "<animation-charging> <label-charging>"; };
discharging = colors.active // { text = "<animation-discharging> <label-discharging>"; };
full = colors.normal // { text = " <label-full>"; };
charging = recursiveUpdate colors.selected { text = "<animation-charging> <label-charging>"; };
discharging = recursiveUpdate colors.active { text = "<animation-discharging> <label-discharging>"; };
full = recursiveUpdate colors.normal { text = " <label-full>"; };
};
label.text = "%percentage%%";
@ -173,18 +174,16 @@ in
};
in
{
focused = colors.selected // common;
occupied = colors.active // common;
urgent = colors.active // common // { background = colors.alert; };
empty = colors.normal // common // { text = "󰧟"; padding = 0; };
focused = recursiveUpdate colors.selected common;
occupied = recursiveUpdate colors.active common;
urgent = recursiveUpdate (recursiveUpdate colors.active common) { background = colors.alert; };
empty = recursiveUpdate (recursiveUpdate colors.normal common) { text = "󰧟"; padding = 0; };
};
};
"module/cpu" = {
type = "internal/cpu";
format = colors.normal // {
text = " <label>";
};
format = recursiveUpdate colors.normal { text = " <label>"; };
interval = 2;
label = "%percentage-sum%%";
ramp-load = ramp;
@ -207,9 +206,7 @@ in
"module/memory" = {
type = "internal/memory";
format = colors.normal // {
text = " <label>";
};
format = recursiveUpdate colors.normal { text = " <label>"; };
interval = 2;
label = "%percentage_used%%";
ramp-used = ramp;
@ -237,7 +234,7 @@ in
format = {
padding = 1;
muted = colors.active;
volume = colors.normal // { text = "<ramp-volume> <label-volume>"; };
volume = recursiveUpdate colors.normal { text = "<ramp-volume> <label-volume>"; };
};
label.muted.text = " muted";
label.volume.text = "%percentage%%";
@ -246,7 +243,7 @@ in
};
"module/temperature" = {
format = colors.normal // {
format = recursiveUpdate colors.normal {
text = "<ramp> <label>";
warn = {
text = "<ramp> <label-warn>";
@ -272,8 +269,8 @@ in
suffix = " ";
};
label = {
open = colors.normal // { text = " "; };
close = colors.normal // { text = "Cancel"; };
open = recursiveUpdate colors.normal { text = " "; };
close = recursiveUpdate colors.normal { text = "Cancel"; };
separator = { text = "|"; };
};
menu = [
@ -300,7 +297,7 @@ in
"module/player" = {
type = "custom/script";
format = colors.normal // { padding = 0; };
format = recursiveUpdate colors.normal { padding = 0; };
exec = playerStatus;
click.left = "${playerCtl} play-pause";
scroll = {