home/polybar: add colors to battery module

This commit is contained in:
Dmitriy Pleshevskiy 2022-10-02 21:17:34 +03:00
parent 0defc044e5
commit 33306d3d1c
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 14 additions and 6 deletions

View file

@ -17,6 +17,7 @@ let
};
};
padding = 1;
in
{
"bar/main" = {
@ -27,6 +28,7 @@ in
"Fira Code:size=9:antialias=true"
"Fira Code:bold:size=9:antialias=true"
"FiraCode Nerd Font Mono:size=9:antialias=true"
"FiraCode Nerd Font Mono:size=14:antialias=true"
];
radius = 0;
modules = {
@ -41,7 +43,7 @@ in
interval = 10;
date = "%a %d %b %Y";
label = "%date%";
format.padding = 1;
format = { inherit padding; };
};
"module/time" = {
@ -57,8 +59,8 @@ in
"module/lang" = {
type = "internal/xkeyboard";
format = {
inherit padding;
text = "<label-layout>";
padding = 1;
};
label.layout.font = 2;
};
@ -68,12 +70,12 @@ in
exec = "~/scripts/get_volume.sh";
interval = 1;
format = {
prefix = "%{T3}%{T-} ";
padding = 1;
inherit padding;
prefix = "%{T4}%{T-} ";
};
};
"module/battery" = let padding = 1; in {
"module/battery" = {
type = "internal/battery";
full-at = 99;
low-at = 10;
@ -83,21 +85,25 @@ in
format.charging = {
inherit padding;
text = "%{T3}%{T-} <label-charging>";
foreground = colors.green;
};
format.discharging = {
inherit padding;
text = "%{T3}<ramp-capacity>%{T-} <label-discharging>";
foreground = colors.orange;
};
format.full = {
inherit padding;
text = "%{T3}%{T-} <label-full>";
foreground = colors.green;
};
format.low = {
inherit padding;
text = "%{T3}%{T-} <label-low>";
foreground = colors.red;
};
# Only applies if <ramp-capacity> is used
@ -118,8 +124,8 @@ in
exec = "~/scripts/exchangerate.sh";
interval = 60;
format = {
inherit padding;
prefix = "USD: ";
padding = 1;
};
};

View file

@ -9,6 +9,8 @@ let
# TODO: create a theme
colors = {
orange = "#ee9a00";
red = "#ff5555";
green = "#50fa7b";
};
polybarConfig = import ./config.nix { inherit lib config pkgs colors; };