{
pkgs,
theme,
...
}: {
services.polybar = {
enable = true;
# TODO: Dynamically start based on monitor configuration
# TODO: Kill polybar if it's already running
script = ''
polybar main &
polybar second &
'';
settings = {
colors = {
bg = theme.dark.black;
fg = theme.bright.white;
};
"section/base" = {
width = "100%";
height = 32;
modules-left = "workspaces";
background = "\${colors.bg}";
foreground = "\${colors.fg}";
fixed-center = true;
module.margin = 1;
padding.right = 1;
# font = [ "Cozette:size=13;1" ];
font = ["Iosevka:size=9"];
};
"bar/main" = {
"inherit" = "section/base";
monitor = "DP-0";
modules-center = "time";
modules-right = "date";
};
"bar/second" = {
"inherit" = "section/base";
monitor = "eDP-1-1";
modules-right = "time date";
};
"module/workspaces" = {
type = "internal/i3";
format = "<label-state>";
index-sort = true;
pin-workspaces = true;
ws-icon =
builtins.genList (idx: let name = toString (idx + 1); in "${name};${name}") 5
++ ["6;q" "7;w" "8;e" "9;r" "0;t"];
label = {
focused = {
text = "%icon%";
padding = 1;
foreground = theme.bright.white;
};
unfocused = {
text = "%icon%";
padding = 1;
foreground = theme.bright.black;
};
visible = {
text = "%icon%";
padding = 1;
foreground = theme.bright.cyan;
};
urgent = {
text = "%icon%";
padding = 1;
foreground = theme.bright.red;
};
};
};
"module/time" = {
type = "internal/date";
label = "%time%";
time = "%H:%M:%S";
};
"module/date" = {
type = "internal/date";
label = "%date%";
date.text = "%A, %d %B %Y";
date.alt = "%Y-%m-%d";
};
};
};
}