{ config, pkgs, lib, ... }: with lib; let cfg = config.local.gui.polybar; in { options.local.gui.polybar.enable = mkEnableOption "Polybar"; config = mkIf cfg.enable { services.polybar = mkIf (!config.home.isolation.active) { enable = true; package = pkgs.polybarFull; script = '' # 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 # Launch Polybar, using default config location ~/.config/polybar/config polybar -r main & polybar -r secondary & ''; settings = { "colors" = { # background = "\${xrdb:color0:#222}"; background = "#AA000000"; background-alt = "#00000000"; # foreground = "\${xrdb:color7:#222}"; foreground = "#ffffff"; foreground-alt = "#ffffff"; primary = "#ffffff"; secondary = "#e60053"; alert = "#bd2c40"; }; "bar/main" = { monitor = "${config.local.display."0"}"; width = "100%"; height = 30; offset-x = "0%"; offset-y = "0%"; radius = 0.0; fixed-center = false; background = "\${colors.background}"; foreground = "\${colors.foreground}"; line-size = 1; line-color = "#f0000000"; border-size = 0; border-color = "#00000000"; padding-left = 0; padding-right = 0; module-margin-left = 1; module-margin-right = 1; # font-0 = "fixed:pixelsize=10;1"; font-0 = "JetBrains Mono Light:size=10;0"; font-1 = "unifont:fontformat=truetype:size=8:antialias=false;0"; font-2 = "siji:pixelsize=10;1"; # font-2 = "FontAwesome5Free:style=Regular:size=10;4"; modules-left = "i3"; modules-center = "xwindow"; modules-right = "xkeyboard pulseaudio filesystem memory cpu temperature gputemperature nvmetemperature wlan eth date semanatec"; separator = "|"; tray-position = "right"; tray-padding = 2; # To allow other windows to be placed above the bar, or to avoid having the bar visible when in fullscreen mode, # you need to use the following two parameters. Note that it will tell the window manager to back off so no # area will be reserved, etc. # # wm-restack = "i3"; # override-redirect = true; cursor-click = "pointer"; cursor-scroll = "ns-resize"; }; "bar/secondary" = optionalAttrs (config.local.display."1" != null) { monitor = "${config.local.display."1"}"; "inherit" = "bar/main"; modules-left = "i3"; modules-center = "xwindow"; modules-right = "xkeyboard pulseaudio date"; tray-position = "none"; }; "module/xwindow" = { type = "internal/xwindow"; label = "%title:0:30:...%"; }; "module/xkeyboard" = { type = "internal/xkeyboard"; blacklist-0 = "num lock"; format-prefix = ""; format-prefix-foreground = "\${colors.foreground-alt}"; label-layout = "%layout%"; label-indicator-padding = 2; label-indicator-margin = 1; label-indicator-background = "\${colors.secondary}"; }; "module/filesystem" = { type = "internal/fs"; interval = 10; mount-0 = "/"; label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %used%/%total%"; label-unmounted = ""; }; "module/i3" = { type = "internal/i3"; format = " "; index-sort = true; wrapping-scroll = false; # Only show workspaces on the same output as the bar # pin-workspaces = true label-mode-padding = 1; label-mode-foreground = "#000"; label-mode-background = "\${colors.primary}"; # focused = Active workspace on focused monitor label-focused = "%index%"; label-focused-background = "\${colors.background}"; label-focused-underline = "\${colors.primary}"; label-focused-padding = 1; # unfocused = Inactive workspace on any monitor label-unfocused = "%index%"; label-unfocused-padding = 1; # visible = Active workspace on unfocused monitor label-visible = "%index%"; label-visible-background = "\${self.label-focused-background}"; label-visible-underline = "\${self.label-focused-underline}"; label-visible-padding = "\${self.label-focused-padding}"; # urgent = Workspace with urgency hint set label-urgent = "%index%"; label-urgent-background = "\${colors.alert}"; label-urgent-padding = 1; }; "module/xbacklight" = { type = "internal/xbacklight"; format = "