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

View file

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