diff options
Diffstat (limited to 'lib/polybar.nix')
| -rw-r--r-- | lib/polybar.nix | 235 |
1 files changed, 124 insertions, 111 deletions
diff --git a/lib/polybar.nix b/lib/polybar.nix index dc384f6..d3d5c3d 100644 --- a/lib/polybar.nix +++ b/lib/polybar.nix @@ -5,71 +5,105 @@ let inherit (import ./theme.nix { inherit pkgs lib; }) colors theme; - size-int = fontSize*2; + size-int = fontSize + 3; size = toString size-int; + bar-height = size-int + 16; bar-common = { background = colors."${theme}".background; foreground = colors."${theme}".foreground; - font-0 = "FiraSans:size=${size};0"; - font-1 = "Font Awesome 5:pixelsize=${size};0"; - font-2 = "MaterialIcons:size=${size}:antialias=false;0"; + font-0 = "Fira Code:size=${size};2"; + font-1 = "Font Awesome 5 Free:style=Solid:pixelsize=${size};2"; + font-2 = "Noto Color Emoji:scale=10;2"; - line-size = "${size}pt"; - border-size = "5pt"; + line-size = "2pt"; + border-size = "0pt"; - height = "${toString (size-int+14)}pt"; + height = "${toString bar-height}pt"; width = "100%"; - radius = 6; - padding-left = 0; + radius = 0; + padding-left = 1; padding-right = 1; module-margin = 1; enable-ipc = true; - - # these are deprecated, i need to rework this - tray-background = colors."${theme}".background; - tray-detached = false; - tray-maxsize = size-int; - tray-padding = 5; - tray-scale = 1; }; in { services.polybar = { config = { - "bar/perf" = bar-common // { - modules-center = "date"; - modules-left = [ "eth" ]; - modules-right = [ "mem" "temp" ]; - radius = 0; - separator = "|"; + # Top bar: user-level work stuff (workspaces, date, tray) + "bar/top" = bar-common // { + modules-left = [ "ewmh" ]; + modules-center = [ "date" ]; + modules-right = [ "pulseaudio" "battery" ]; tray-position = "right"; + tray-background = colors."${theme}".background; + tray-padding = 4; + separator = " "; + separator-foreground = colors.${theme}.highlight; }; - "bar/cpu" = bar-common // { - modules-center = ["cpu"]; + # Bottom bar: memory, temp, network (stacked above CPU bar) + "bar/bottom" = bar-common // { + bottom = true; + offset-y = "${toString bar-height}pt"; + modules-left = [ "mem" ]; + modules-center = [ "temp" ]; + modules-right = [ "network-speed" ]; + separator = " โ "; + separator-foreground = colors.${theme}.highlight; }; - "bar/org" = bar-common // { - modules-right = [ "date" ]; - modules-left = ["ewmh" ]; - radius = 0; - separator = "|"; + # CPU bar: very bottom, just CPU cores + "bar/cpu" = bar-common // { + bottom = true; + modules-center = [ "cpu" ]; }; "module/ewmh" = { type = "internal/xworkspaces"; - label-active-foreground = "#fff"; + pin-workspaces = false; + enable-click = true; + enable-scroll = true; + label-active = "%name%"; + label-active-foreground = colors.${theme}.background; + label-active-background = colors.${theme}.cursor; + label-active-padding = 1; + label-occupied = "%name%"; + label-occupied-foreground = colors.${theme}.foreground; + label-occupied-padding = 1; + label-urgent = "%name%"; + label-urgent-foreground = colors.${theme}.background; + label-urgent-background = colors.${theme}.red; + label-urgent-padding = 1; + label-empty = "%name%"; + label-empty-foreground = colors.${theme}.cyan; + label-empty-padding = 1; }; "module/date" = { type = "internal/date"; - internal = 5; - date = "%Y.%m.%d"; - time = "%H.%M"; - label = "%date%..%time%"; + interval = 5; + date = "%a %Y.%m.%d"; + time = "%H:%M"; + label = "%date% %time%"; + label-foreground = colors.${theme}.foreground; + }; + + "module/pulseaudio" = { + type = "internal/pulseaudio"; + use-ui-max = false; + interval = 5; + format-volume = "<ramp-volume> <label-volume>"; + label-volume = "%percentage%%"; + label-muted = "๐ muted"; + label-muted-foreground = colors.${theme}.cyan; + ramp-volume-0 = "๐"; + ramp-volume-1 = "๐"; + ramp-volume-2 = "๐"; + click-right = "pwvucontrol &"; }; "module/battery" = { @@ -77,73 +111,55 @@ in { battery = "BAT0"; adapter = "AC"; full-at = 99; - }; - - "module/volume-bar" = { - type = "internal/alsa"; - master-soundcard = "hw:1"; - bar-volume-font = 2; - bar-volume-width = 9; - format-volume = "<label-volume><bar-volume>"; - label-volume = " .) "; - label-muted = " .) mute"; - label-volume-foreground = colors.${theme}.foreground; - format-muted-foreground = colors.${theme}.foreground; - bar-volume-foreground-0 = colors.${theme}.foreground; - bar-volume-foreground-1 = colors.${theme}.foreground; - bar-volume-foreground-2 = colors.${theme}.foreground; - bar-volume-foreground-3 = colors.${theme}.foreground; - bar-volume-foreground-4 = colors.${theme}.foreground; - bar-volume-foreground-5 = colors.${theme}.foreground; - bar-volume-foreground-6 = colors.${theme}.foreground; - bar-volume-gradient = true; - bar-volume-indicator = "โข"; - bar-volume-fill = "โข"; - bar-volume-empty = "ยท"; - bar-volume-empty-foreground = colors.${theme}.foreground; - }; - - "network-base" = { - type = "internal/network"; - interval = 5; - format-connected = "<label-connected>"; - format-disconnected = "<label-disconnected>"; - label-disconnected = "%{F#F0C674}%ifname%%{F#707880} disconnected"; - }; - - "module/eth" = { - "inherit" = "network-base"; - interface-type = "wired"; - label-connected = "%{F#F0C674}%ifname%%{F-} %local_ip%"; - #label-connected = "eth up: %upspeed:9% down: %downspeed%"; - #label-disconnected = "no eth"; - }; - - "module/wifi" = { - type = "internal/network"; - interface = "wlan1"; - label-connected = "wifi up: %upspeed% down: %downspeed%"; - label-disconnected = "no wifi"; + format-charging = "โก <label-charging>"; + format-discharging = "๐ <label-discharging>"; + format-full = "โ <label-full>"; + label-charging = "%percentage%%"; + label-discharging = "%percentage%%"; + label-full = "%percentage%%"; }; "module/cpu" = { type = "internal/cpu"; - interval = 3; + interval = 2; format-padding = 1; format = "<label> <ramp-coreload>"; - label = " %percentage:2%%"; - ramp-coreload-0 = "โ"; - ramp-coreload-1 = "โ"; - ramp-coreload-2 = "โ"; - ramp-coreload-3 = "โ
"; - ramp-coreload-4 = "โ"; - ramp-coreload-5 = "โ"; - ramp-coreload-0-foreground = colors.${theme}.foreground; - ramp-coreload-1-foreground = colors.${theme}.foreground; + label = "CPU %percentage:2%%"; + label-foreground = colors.${theme}.blue; + ramp-coreload-0 = "โ"; + ramp-coreload-1 = "โ"; + ramp-coreload-2 = "โ"; + ramp-coreload-3 = "โ"; + ramp-coreload-4 = "โ
"; + ramp-coreload-5 = "โ"; + ramp-coreload-6 = "โ"; + ramp-coreload-7 = "โ"; + ramp-coreload-0-foreground = colors.${theme}.green; + ramp-coreload-1-foreground = colors.${theme}.green; ramp-coreload-2-foreground = colors.${theme}.foreground; ramp-coreload-3-foreground = colors.${theme}.foreground; - ramp-coreload-4-foreground = colors.${theme}.foreground; - ramp-coreload-5-foreground = colors.${theme}.highlight; + ramp-coreload-4-foreground = colors.${theme}.yellow; + ramp-coreload-5-foreground = colors.${theme}.yellow; + ramp-coreload-6-foreground = colors.${theme}.red; + ramp-coreload-7-foreground = colors.${theme}.red; + }; + + "module/mem" = { + type = "internal/memory"; + interval = 3; + format = "<label> <bar-used>"; + label = "RAM %percentage_used%%"; + label-foreground = colors.${theme}.magenta; + bar-used-width = 20; + bar-used-foreground-0 = colors.${theme}.green; + bar-used-foreground-1 = colors.${theme}.green; + bar-used-foreground-2 = colors.${theme}.yellow; + bar-used-foreground-3 = colors.${theme}.red; + bar-used-indicator = "โ"; + bar-used-indicator-foreground = colors.${theme}.foreground; + bar-used-fill = "โ"; + bar-used-empty = "โ"; + bar-used-empty-foreground = colors.${theme}.highlight; }; "module/temp" = { @@ -154,28 +170,25 @@ in { format = "<ramp> <label>"; format-padding = 1; label = "%temperature-c%"; - ramp-0 = "_"; - ramp-1 = "."; - ramp-2 = ":"; - ramp-3 = "|"; - ramp-4 = "!!"; - ramp-0-foreground = colors.${theme}.foreground; + ramp-0 = "โ"; + ramp-1 = "๐ก"; + ramp-2 = "๐ฅ"; + ramp-0-foreground = colors.${theme}.cyan; ramp-1-foreground = colors.${theme}.foreground; - ramp-2-foreground = colors.${theme}.foreground; - ramp-3-foreground = colors.${theme}.foreground; - ramp-4-foreground = colors.${theme}.highlight; + ramp-2-foreground = colors.${theme}.red; format-warn = "<label-warn>"; - label-warn = " %temperature-c%"; - label-warn-padding = 1; - label-warn-foreground = colors.${theme}.highlight; + label-warn = "๐ฅ %temperature-c%"; + label-warn-foreground = colors.${theme}.red; }; - "module/mem" = { - type = "internal/memory"; - interval = 3; - format = "<label>"; - label-padding = 1; - label = " |[ %percentage_used%% ]|"; + "module/network-speed" = { + type = "internal/network"; + interface-type = "wired"; + interval = 2; + format-connected = "<label-connected>"; + label-connected = "โ %downspeed:8% โ %upspeed:8%"; + label-connected-foreground = colors.${theme}.cyan; + format-disconnected = ""; }; }; |
