{ config, pkgs, lib, ... }: { config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) { toggleBarCommand = "polybar-msg cmd toggle"; home-manager.users.${config.user} = { services.polybar = { enable = true; package = pkgs.polybar.override { pulseSupport = true; githubSupport = true; i3Support = true; }; script = "polybar &"; config = { "bar/main" = { bottom = false; width = "100%"; height = "22pt"; radius = 0; # offset-y = -5; # offset-y = "5%"; # dpi = 96; background = config.theme.colors.base01; foreground = config.theme.colors.base05; line-size = "3pt"; border-top-size = 0; border-right-size = 0; border-left-size = 0; border-bottom-size = "4pt"; border-color = config.theme.colors.base00; padding-left = 2; padding-right = 2; module-margin = 1; modules-left = "i3"; modules-center = "xwindow"; modules-right = "mailcount pulseaudio date power"; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; tray-position = "right"; # wm-restack = "generic"; # wm-restack = "bspwm"; # wm-restack = "i3"; # override-redirect = true; }; "module/i3" = let padding = 2; in { type = "internal/i3"; pin-workspaces = false; show-urgent = true; strip-wsnumbers = true; index-sort = true; enable-click = true; wrapping-scroll = true; fuzzy-match = true; format = " "; label-focused = "%name%"; label-focused-foreground = config.theme.colors.base01; label-focused-background = config.theme.colors.base05; label-focused-underline = config.theme.colors.base03; label-focused-padding = padding; label-unfocused = "%name%"; label-unfocused-padding = padding; label-visible = "%name%"; label-visible-underline = config.theme.colors.base01; label-visible-padding = padding; label-urgent = "%name%"; label-urgent-foreground = config.theme.colors.base00; label-urgent-background = config.theme.colors.base08; label-urgent-underline = config.theme.colors.base0F; label-urgent-padding = padding; }; "module/xworkspaces" = { type = "internal/xworkspaces"; label-active = "%name%"; label-active-background = config.theme.colors.base05; label-active-foreground = config.theme.colors.base01; label-active-underline = config.theme.colors.base03; label-active-padding = 1; label-occupied = "%name%"; label-occupied-padding = 1; label-urgent = "%name%"; label-urgent-background = config.theme.colors.base08; label-urgent-padding = 1; label-empty = "%name%"; label-empty-foreground = config.theme.colors.base06; label-empty-padding = 1; }; "module/xwindow" = { type = "internal/xwindow"; label = "%title:0:60:...%"; }; # "module/filesystem" = { # type = "internal/fs"; # interval = 25; # mount-0 = "/"; # label-mounted = "%{F#F0C674}%mountpoint%%{F-} %percentage_used%%"; # label-unmounted = "%mountpoint% not mounted"; # label-unmounted-foreground = colors.disabled; # }; "module/mailcount" = { type = "custom/script"; interval = 10; format = "