From 33306d3d1cda593c8fce38ac4217ff1a10b6f238 Mon Sep 17 00:00:00 2001 From: janabhumi Date: Sun, 2 Oct 2022 21:17:34 +0300 Subject: [PATCH] home/polybar: add colors to battery module --- home/ui/polybar/config.nix | 18 ++++++++++++------ home/ui/polybar/default.nix | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/home/ui/polybar/config.nix b/home/ui/polybar/config.nix index f5f0c8d..39340a2 100644 --- a/home/ui/polybar/config.nix +++ b/home/ui/polybar/config.nix @@ -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 = ""; - 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-} "; + foreground = colors.green; }; format.discharging = { inherit padding; text = "%{T3}%{T-} "; + foreground = colors.orange; }; format.full = { inherit padding; text = "%{T3}%{T-} "; + foreground = colors.green; }; format.low = { inherit padding; text = "%{T3}%{T-} "; + foreground = colors.red; }; # Only applies if is used @@ -118,8 +124,8 @@ in exec = "~/scripts/exchangerate.sh"; interval = 60; format = { + inherit padding; prefix = "USD: "; - padding = 1; }; }; diff --git a/home/ui/polybar/default.nix b/home/ui/polybar/default.nix index 364c7dd..c32e3b3 100644 --- a/home/ui/polybar/default.nix +++ b/home/ui/polybar/default.nix @@ -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; };