new_dots/home/modules/polybar.nix
2026-01-11 14:39:28 +01:00

140 lines
3.2 KiB
Nix

# home/modules/polybar.nix
{
services.polybar = {
enable = true;
script = "polybar bar &";
settings = {
"bar/primary" = {
monitor = "DVI-I-1";
width = "100%";
height = 30;
radius = 0;
fixed-center = true;
background = "#2e3440";
foreground = "#d8dee9";
line-size = 3;
padding-left = 2;
padding-right = 2;
module-margin-left = 1;
module-margin-right = 1;
font-0 = "FiraCode Nerd Font:size=10;2";
font-1 = "FiraCode Nerd Font:size=12;2";
modules-left = "bspwm";
modules-center = "date";
modules-right = "cpu memory battery";
cursor-click = "pointer";
};
"bar/secondary" = {
monitor = "HDMI-0";
width = "100%";
height = 30;
radius = 0;
fixed-center = true;
background = "#2e3440";
foreground = "#d8dee9";
line-size = 3;
padding-left = 2;
padding-right = 2;
module-margin-left = 1;
module-margin-right = 1;
font-0 = "FiraCode Nerd Font:size=10;2";
font-1 = "FiraCode Nerd Font:size=12;2";
modules-left = "bspwm";
modules-center = "date";
modules-right = "cpu memory battery";
cursor-click = "pointer";
};
"module/bspwm" = {
type = "internal/bspwm";
label-focused = "%name%";
label-focused-background = "#88c0d0";
label-focused-foreground = "#2e3440";
label-focused-padding = 2;
label-occupied = "%name%";
label-occupied-padding = 2;
label-occupied-foreground = "#d8dee9";
label-urgent = "%name%";
label-urgent-background = "#bf616a";
label-urgent-padding = 2;
label-empty = "%name%";
label-empty-foreground = "#4c566a";
label-empty-padding = 2;
};
"module/date" = {
type = "internal/date";
interval = 1;
date = "%Y-%m-%d";
time = "%H:%M:%S";
format-prefix = " ";
format-prefix-foreground = "#88c0d0";
label = "%date% %time%";
};
"module/cpu" = {
type = "internal/cpu";
interval = 2;
format-prefix = " ";
format-prefix-foreground = "#a3be8c";
label = "%percentage:2%%";
};
"module/memory" = {
type = "internal/memory";
interval = 2;
format-prefix = " ";
format-prefix-foreground = "#b48ead";
label = "%percentage_used%%";
};
"module/battery" = {
type = "internal/battery";
battery = "BAT0";
adapter = "AC";
full-at = 98;
format-charging = "<label-charging>";
format-charging-prefix = " ";
format-charging-prefix-foreground = "#a3be8c";
format-discharging = "<label-discharging>";
format-discharging-prefix = " ";
format-discharging-prefix-foreground = "#ebcb8b";
format-full-prefix = " ";
format-full-prefix-foreground = "#a3be8c";
label-charging = "%percentage%%";
label-discharging = "%percentage%%";
label-full = "%percentage%%";
};
};
};
}