# https://github.com/0x746866/dots/blob/master/polybar/config { pkgs, lib, ... }: let inherit (import ./const.nix) fontSize homedir; inherit (import ./theme.nix { inherit pkgs lib; }) colors theme; size-int = fontSize + 3; size = toString size-int; bar-height = size-int + 16; bar-common = { background = colors."${theme}".background; foreground = colors."${theme}".foreground; font-0 = "Fira Code:size=${size};2"; font-1 = "Font Awesome 5 Free:style=Solid:pixelsize=${size};2"; font-2 = "Noto Color Emoji:scale=10;2"; line-size = "2pt"; border-size = "0pt"; height = "${toString bar-height}pt"; width = "100%"; radius = 0; padding-left = 1; padding-right = 1; module-margin = 1; enable-ipc = true; }; in { services.polybar = { config = { # Top bar: user-level work stuff (workspaces, date, tray) "bar/top" = bar-common // { modules-left = [ "ewmh" ]; modules-center = [ "date" ]; modules-right = [ "pulseaudio" "battery" ]; tray-position = "right"; tray-background = colors."${theme}".background; tray-padding = 4; separator = " "; separator-foreground = colors.${theme}.highlight; }; # Bottom bar: memory, temp, network (stacked above CPU bar) "bar/bottom" = bar-common // { bottom = true; offset-y = "${toString bar-height}pt"; modules-left = [ "mem" ]; modules-center = [ "temp" ]; modules-right = [ "network-speed" ]; separator = " │ "; separator-foreground = colors.${theme}.highlight; }; # CPU bar: very bottom, just CPU cores "bar/cpu" = bar-common // { bottom = true; modules-center = [ "cpu" ]; }; "module/ewmh" = { type = "internal/xworkspaces"; pin-workspaces = false; enable-click = true; enable-scroll = true; label-active = "%name%"; label-active-foreground = colors.${theme}.background; label-active-background = colors.${theme}.cursor; label-active-padding = 1; label-occupied = "%name%"; label-occupied-foreground = colors.${theme}.foreground; label-occupied-padding = 1; label-urgent = "%name%"; label-urgent-foreground = colors.${theme}.background; label-urgent-background = colors.${theme}.red; label-urgent-padding = 1; label-empty = "%name%"; label-empty-foreground = colors.${theme}.cyan; label-empty-padding = 1; }; "module/date" = { type = "internal/date"; interval = 5; date = "%a %Y.%m.%d"; time = "%H:%M"; label = "%date% %time%"; label-foreground = colors.${theme}.foreground; }; "module/pulseaudio" = { type = "internal/pulseaudio"; use-ui-max = false; interval = 5; format-volume = " "; label-volume = "%percentage%%"; label-muted = "🔇 muted"; label-muted-foreground = colors.${theme}.cyan; ramp-volume-0 = "🔈"; ramp-volume-1 = "🔉"; ramp-volume-2 = "🔊"; click-right = "pwvucontrol &"; }; "module/battery" = { type = "internal/battery"; battery = "BAT0"; adapter = "AC"; full-at = 99; format-charging = "⚡ "; format-discharging = "🔋 "; format-full = "✓ "; label-charging = "%percentage%%"; label-discharging = "%percentage%%"; label-full = "%percentage%%"; }; "module/cpu" = { type = "internal/cpu"; interval = 2; format-padding = 1; format = "