From 2384b5314eb2fb961bd57d6fb6c5c78cab31dd1c Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 3 Aug 2024 11:42:27 -0400 Subject: fix beryl display the dpi from dpi.lv was completely wrong, i got this number from xrandr, also rotated them vertically and updated my polybar config here --- lib/polybar.nix | 83 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/polybar.nix b/lib/polybar.nix index 3c454cb..dc384f6 100644 --- a/lib/polybar.nix +++ b/lib/polybar.nix @@ -4,32 +4,59 @@ let inherit (import ./const.nix) fontSize homedir; inherit (import ./theme.nix { inherit pkgs lib; }) colors theme; + + size-int = fontSize*2; + size = toString size-int; + + 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"; + + line-size = "${size}pt"; + border-size = "5pt"; + + height = "${toString (size-int+14)}pt"; + width = "100%"; + radius = 6; + padding-left = 0; + 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/top" = { - background = colors."${theme}".background; - font-0 = "FiraSans:size=${toString fontSize}"; - font-1 = "Font Awesome 5:pixelsize=11;1"; - font-2 = "MaterialIcons:size=10:antialias=false;2"; - foreground = colors."${theme}".foreground; - height = "30"; - module-margin = 1; + "bar/perf" = bar-common // { modules-center = "date"; - modules-left = ["ewmh" "volume-bar"]; - modules-right = [ "battery" "cpu" "mem" "temp" ]; + modules-left = [ "eth" ]; + modules-right = [ "mem" "temp" ]; radius = 0; separator = "|"; - tray-background = colors."${theme}".background; - tray-detached = false; - tray-maxsize = 16; - tray-offset-x = 0; - tray-offset-y = 0; - tray-padding = 0; tray-position = "right"; - tray-scale = 1; - width = "100%"; + }; + + "bar/cpu" = bar-common // { + modules-center = ["cpu"]; + }; + + "bar/org" = bar-common // { + modules-right = [ "date" ]; + modules-left = ["ewmh" ]; + radius = 0; + separator = "|"; }; "module/ewmh" = { @@ -76,11 +103,20 @@ in { bar-volume-empty-foreground = colors.${theme}.foreground; }; - "module/ethernet" = { + "network-base" = { type = "internal/network"; - interface = "enp1s0"; - label-connected = "eth up: %upspeed:9% down: %downspeed%"; - label-disconnected = "no eth"; + interval = 5; + format-connected = ""; + format-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" = { @@ -145,4 +181,3 @@ in { }; }; } - -- cgit v1.2.3