{ config, base16, pkgs, lib, ... }: with lib; { systemd.user.services.polybar.Service.Environment = mkForce [ "PATH=/nix/store/bmh5zjsihnyim0pmhgnnmn4adribvns6-polybar-3.5.7/bin:/run/wrappers/bin" "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}" ]; services.polybar = { enable = true; script = let xrandr = filter: "${pkgs.xorg.xrandr}/bin/xrandr -q | ${pkgs.gnugrep}/bin/grep -F ' ${filter}' | ${pkgs.coreutils}/bin/cut -d' ' -f1"; in mkIf config.xsession.enable '' primary=$(${xrandr "connected primary"}) for display in $(${xrandr "connected"}); do export POLYBAR_MONITOR=$display export POLYBAR_MONITOR_PRIMARY=$([[ $primary = $display ]] && echo true || echo false) export POLYBAR_TRAY_POSITION=$([[ $primary = $display ]] && echo right || echo none) polybar kat & done ''; package = pkgs.polybarFull; config = { "bar/base" = { modules-left = mkMerge [ (mkIf config.xsession.windowManager.i3.enable (mkBefore [ "i3" ])) [ "title" ] ]; modules-center = mkMerge [ (mkAfter [ "arc" "hex" "miku" "date" ]) ]; modules-right = mkMerge [ (mkOrder 1240 [ "pulseaudio" "headset" "mail" ]) (mkOrder 1250 [ "cpu" "temp" "ram" "net-enp34s0" ]) (mkOrder 1490 [ "gpg" ]) ]; }; }; settings = let colours = base16.map.hash.argb; warn-colour = colours.constant; # or deleted in with colours; { "bar/kat" = { "inherit" = "bar/base"; monitor = { text = mkIf config.xsession.enable "\${env:POLYBAR_MONITOR:}"; }; height = 20; enable-ipc = true; tray = { maxsize = 12; position = "\${env:POLYBAR_TRAY_POSITION:right}"; }; offset = { x = 0; y = 0; }; dpi = { x = 0; y = 0; }; spacing = 0; scroll = { up = "#i3.prev"; down = "#i3.next"; }; font = [ "${config.kw.theme.font.name}:size=9;2" "Font Awesome 5 Free Solid:size=9;2" "Font Awesome 5 Free Brands:size=9;2" ]; padding = { left = 1; right = 1; }; separator = { text = " "; foreground = foreground_status; }; background = "#b219171c"; foreground = foreground_alt; border = { bottom = { size = 1; color = background_light; }; }; module-margin = 0; #click-right = ""; menu of some sort? }; "module/i3" = mkIf config.xsession.windowManager.i3.enable { type = "internal/i3"; pin-workspaces = true; strip-wsnumbers = true; wrapping-scroll = false; enable-scroll = false; # handled by bar instead label = { mode = { padding = 2; foreground = constant; background = background_selection; }; focused = { text = "%name%"; padding = 2; foreground = background_alt; background = regex; }; unfocused = { text = "%name%"; padding = 2; foreground = foreground_alt; background = background_light; }; visible = { text = "%name%"; padding = 2; foreground = foreground; #background = background; }; urgent = { text = "%name%"; padding = 2; foreground = foreground_status; background = link; }; }; }; "module/title" = { type = "internal/xwindow"; label = { text = "%title:0:50:%"; padding = 1; }; format = { text = "