{ pkgs, home-manager, ... }: { services.polybar = { enable = true; package = pkgs.polybar.override { i3Support = true; pulseSupport = true; }; script = '' PATH="$PATH:/run/current-system/sw/bin" # Terminate already running bar instances killall -q polybar # Wait until the processes have been shut down while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done IFS=$'\n' for m in $(xrandr --query | grep " connected"); do if [[ $m = *primary* ]]; then MONITOR=$(echo $m | cut -d" " -f1) polybar --reload bottom_main & else MONITOR=$(echo $m | cut -d" " -f1) polybar --reload bottom & fi done ''; settings = { "colors" = { background = "#222"; background-alt = "#444"; foreground = "#dfdfdf"; foreground-alt = "#999"; primary = "#ffb52a"; secondary = "#e60053"; alert = "#bd2c40"; }; "bar/bottom" = { monitor = "\${env:MONITOR:}"; bottom = true; radius = 0; height = 25; width = "100%"; padding = 1; line-size = 3; module-margin = 1; background = "\${colors.background}"; foreground = "\${colors.foreground}"; font = [ "fixed:pixelsize=14;1" "unifont:fontformat=truetype:size=12:antialias=false;0" "FontAwesome5Free-Solid:weight=heavy:size=12" #"siji:pixelsize=14;1" ]; modules-left = "hostname bspwm i3"; modules-center = "mpd"; modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date"; scroll-up = "i3wm-wsnext"; scroll-down = "i3wm-wsprev"; }; "bar/bottom_main" = { monitor = "\${env:MONITOR:}"; bottom = true; radius = 0; height = 25; width = "100%"; padding = 1; line-size = 3; module-margin = 1; background = "\${colors.background}"; foreground = "\${colors.foreground}"; font = [ "fixed:pixelsize=14;1" "unifont:fontformat=truetype:size=12:antialias=false;0" "FontAwesome5Free-Solid:weight=heavy:size=12" #"siji:pixelsize=14;1" ]; modules-left = "hostname bspwm i3"; modules-center = "mpd"; modules-right = "dirty root xbacklight volume wlan eth zram memory cpu battery date tray"; scroll-up = "i3wm-wsnext"; scroll-down = "i3wm-wsprev"; }; "module/tray" = { type = "internal/tray"; }; "module/root" = { type = "internal/fs"; interval = "10"; mount = [ "/" ]; format-mounted = " "; format-mounted-underline = "#f876cd"; label-mounted = "%mountpoint%%{F-} %free% of %total%"; label-mounted-foreground = "\${colors.foreground-alt}"; bar-used-width = 10; bar-used-fill = "█"; bar-used-empty = "█"; bar-used-indicator = ""; bar-used-empty-foreground = "#444444"; format-prefix = " "; format-prefix-foreground = "\${colors.foreground-alt}"; }; "module/battery" = { type = "internal/battery"; format-charging = " "; format-charging-underline = "#ffb52a"; format-discharging = " "; format-discharging-underline = "#ffb52a"; format-full-prefix = " "; format-full-prefix-foreground = "\${colors.foreground-alt}"; format-full-underline = "#ffb52a"; ramp-capacity = [" " " " " " " " " "]; animation-charging = [" " " " " " " " " "]; animation-charging-framerate = 750; }; "module/hostname" = { type = "custom/script"; exec = "echo $(uname -n)"; interval = 256; format = "