{ config, lib, pkgs, ... }: let grep = "${pkgs.gnugrep}/bin/grep"; cut = "${pkgs.coreutils}/bin/cut"; head = "${pkgs.coreutils}/bin/head"; pavucontrol = "${pkgs.pavucontrol}/bin/pavucontrol"; pgrep = "${pkgs.procps}/bin/pgrep"; pkill = "${pkgs.procps}/bin/pkill"; playerCtl = "${pkgs.playerctl}/bin/playerctl"; playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60"; alacritty = "${pkgs.alacritty}/bin/alacritty"; btm = "${pkgs.bottom}/bin/btm"; colors = with pkgs.rice; palette.toARGBHex rec { normal = { foreground = colorPalette.primary.foreground; background = colorPalette.primary.background; underline = colorPalette.normal.blue; }; active = palette.tPalette (c: color.brighten c "50%") normal; selected = { foreground = colorPalette.bright.white; background = color.tAlphaRgba (v: 240) colorPalette.dim.blue; underline = colorPalette.dim.white; }; alert = colorPalette.bright.red; green = colorPalette.normal.green; yellow = colorPalette.normal.yellow; orange = colorPalette.bright.red; red = colorPalette.normal.red; transparent = color.transparent; }; commonBar = { locale = config.home.language.base; monitor = "\${env:MONITOR}"; width = "100%"; height = 20; radius = 6.0; fixed-center = false; background = colors.normal.background; foreground = colors.normal.foreground; line-size = 2; line-color = colors.normal.underline; padding = { left = 0; right = 0; }; module.margin = { left = 0; right = 0; }; separator = " "; border = { color = colors.transparent; left.size = 2; righ.sizet = 2; top.size = 2; bottom.size = 0; }; font = [ "${pkgs.rice.font.monospace.name}:size=${toString pkgs.rice.font.monospace.size};2" "Material Design Icons:size=${toString pkgs.rice.font.monospace.size};2" "NotoEmoji Nerd Font Mono:size=${toString pkgs.rice.font.monospace.size};0" ]; wm-restack = "bspwm"; }; ramp = [ "▂" "▃" "▄" "▅" "▆" "▇" ]; in { home.packages = with pkgs; [ pkgs.rice.font.monospace.package emojione noto-fonts-emoji material-design-icons ]; services.polybar = { enable = true; package = pkgs.polybarFull; script = '' monitor=`polybar -m | ${grep} primary | ${cut} -d":" -f1` MONITOR=$monitor polybar primary & monitors=(`polybar -m | ${grep} -v primary | ${cut} -d":" -f1`) for monitor in "''${monitors[@]}"; do MONITOR=$monitor polybar secondary & done ''; settings = { "settings" = { screenchange-reload = false; }; "bar/primary" = commonBar // { modules-left = "bspwm"; # modules-center = modules-right = "player pulseaudio temperature cpu memory battery date powermenu"; enable-ipc = true; tray = { position = "right"; padding = 0; }; }; "bar/secondary" = commonBar // { modules-left = "bspwm"; # modules-center = modules-right = "player pulseaudio temperature cpu memory battery date powermenu"; enable-ipc = true; }; "module/battery" = { type = "internal/battery"; adapter = "AC"; battery = "BAT0"; full.at = 98; animation = { charging = { text = [ "" "" "" "" "" "" "" "" "" "" ]; framerate = "750"; }; discharging = { text = [ "" "" "" "" "" "" "" "" "" "" ]; framerate = "750"; }; }; format = { charging = colors.selected // { padding = 1; text = " "; }; discharging = colors.active // { padding = 1; text = " "; }; full = colors.normal // { padding = 1; text = " "; }; }; label = { chargin = "%percentage%%"; dischargin = "%percentage%%"; full = "%percentage%%"; }; }; "module/bspwm" = { type = "internal/bspwm"; format = ""; label = let common = { padding = 1; separator = " "; text = "%name%"; }; in { focused = colors.selected // common; occupied = colors.active // common; urgent = colors.active // common // { background = colors.alert; }; empty = colors.normal // common // { text = "󰧟"; padding = 0 ; }; }; }; "module/cpu" = { type = "internal/cpu"; format = colors.normal // { text = "󰍛