Fix redundant polybar color definitions

inky
Elnu 2 years ago
parent b8d4ced114
commit 5180740b3e

@ -19,4 +19,3 @@
- Fix kitty bell disable not working - Fix kitty bell disable not working
- Add Gruvbox switching support - Add Gruvbox switching support
- kitty theme is "Gruvbox Dark", [see the full list](https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json). - kitty theme is "Gruvbox Dark", [see the full list](https://github.com/kovidgoyal/kitty-themes/blob/master/themes.json).
- Somehow remove redundant color definitions in [`hosts/elnupad/polybar.nix`](hosts/elnupad/polybar.nix)

@ -1,13 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
# TODO: eliminate redundant color definitions colors = import ../../polybar/colors.nix;
background = "#2e3440";
background-alt = "#3b4252";
foreground = "#eceff4";
primary = "#8fbcbb";
alert = "#bf616a";
disabled = "#434c5e";
in in
{ {
home.packages = with pkgs; [ lm_sensors ]; home.packages = with pkgs; [ lm_sensors ];
@ -26,12 +20,12 @@ in
format-low = "<animation-low> <label-low>"; format-low = "<animation-low> <label-low>";
label-charging = "%{F${primary}}AC%{F-} %percentage%%"; label-charging = "%{F${colors.primary}}AC%{F-} %percentage%%";
label-discharging = "%{F${primary}}BAT%{F-} %percentage%%"; label-discharging = "%{F${colors.primary}}BAT%{F-} %percentage%%";
label-full = "%{F${primary}}AC%{F-}"; label-full = "%{F${colors.primary}}AC%{F-}";
animation-low-0 = "%{F${primary}}BAT%{F-}"; animation-low-0 = "%{F${colors.primary}}BAT%{F-}";
animation-low-1 = "%{F${alert}}LOW%{F-}"; animation-low-1 = "%{F${colors.alert}}LOW%{F-}";
full-at = 96; full-at = 96;
low-at = 10; # default low-at = 10; # default

@ -0,0 +1,8 @@
{
background = "#2e3440";
background-alt = "#3b4252";
foreground = "#eceff4";
primary = "#8fbcbb";
alert = "#bf616a";
disabled = "#434c5e";
}

@ -1,12 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
background = "#2e3440"; colors = import ./colors.nix;
background-alt = "#3b4252";
foreground = "#eceff4";
primary = "#8fbcbb";
alert = "#bf616a";
disabled = "#434c5e";
in in
{ {
# Dependencies # Dependencies
@ -28,8 +23,8 @@ in
"bar/top" = { "bar/top" = {
font-0 = "Noto Sans Mono;2"; font-0 = "Noto Sans Mono;2";
font-1 = "Noto Sans CJK JP;2"; font-1 = "Noto Sans CJK JP;2";
background = "${background}"; background = "${colors.background}";
foreground = "${foreground}"; foreground = "${colors.foreground}";
width = "100%"; width = "100%";
height = "24pt"; height = "24pt";
@ -37,7 +32,7 @@ in
padding-right = 1; padding-right = 1;
module-margin = 1; module-margin = 1;
separator = "|"; separator = "|";
separator-foreground = "${disabled}"; separator-foreground = "${colors.disabled}";
cursor-click = "pointer"; cursor-click = "pointer";
cursor-scroll = "ns-resize"; cursor-scroll = "ns-resize";
modules-left = [ modules-left = [
@ -59,16 +54,16 @@ in
"module/xworkspaces" = { "module/xworkspaces" = {
type = "internal/xworkspaces"; type = "internal/xworkspaces";
label-active-background = "${background-alt}"; label-active-background = "${colors.background-alt}";
label-active-underline = "${primary}"; label-active-underline = "${colors.primary}";
label-active-padding-right = 1; label-active-padding-right = 1;
label-occupied-padding-right = 1; label-occupied-padding-right = 1;
label-urgent-background = "${alert}"; label-urgent-background = "${colors.alert}";
label-urgent-padding-right = 1; label-urgent-padding-right = 1;
label-empty-foreground = "${disabled}"; label-empty-foreground = "${colors.disabled}";
label-empty-padding-right = 1; label-empty-padding-right = 1;
}; };
"module/xwindow" = { "module/xwindow" = {
@ -98,16 +93,16 @@ in
label-mounted = "%{F#88c0d0}%mountpoint%%{F-} %percentage_used%%"; label-mounted = "%{F#88c0d0}%mountpoint%%{F-} %percentage_used%%";
label-unmounted = "%mountpoint% not mounted"; label-unmounted = "%mountpoint% not mounted";
label-unmounted-foreground = "${disabled}"; label-unmounted-foreground = "${colors.disabled}";
}; };
"module/pulseaudio" = { "module/pulseaudio" = {
type = "internal/pulseaudio"; type = "internal/pulseaudio";
format-volume-prefix = "VOL "; format-volume-prefix = "VOL ";
format-volume-prefix-foreground = "${primary}"; format-volume-prefix-foreground = "${colors.primary}";
label-muted = "muted"; label-muted = "muted";
label-muted-foreground = "${disabled}"; label-muted-foreground = "${colors.disabled}";
}; };
"module/memory" = { "module/memory" = {
type = "internal/memory"; type = "internal/memory";
@ -115,7 +110,7 @@ in
interval = 2; interval = 2;
format-prefix = "RAM "; format-prefix = "RAM ";
format-prefix-foreground = "${primary}"; format-prefix-foreground = "${colors.primary}";
}; };
"module/cpu" = { "module/cpu" = {
type = "internal/cpu"; type = "internal/cpu";
@ -123,7 +118,7 @@ in
interval = 2; interval = 2;
format-prefix = "CPU "; format-prefix = "CPU ";
format-prefix-foreground = "${primary}"; format-prefix-foreground = "${colors.primary}";
}; };
"module/date" = { "module/date" = {
type = "internal/date"; type = "internal/date";
@ -133,7 +128,7 @@ in
date = "%H:%M"; date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S"; date-alt = "%Y-%m-%d %H:%M:%S";
label-foreground = "${primary}"; label-foreground = "${colors.primary}";
}; };
}; };
}; };

Loading…
Cancel
Save