diff options
-rw-r--r-- | lib/polybar.nix | 83 | ||||
-rw-r--r-- | profiles/beryllium.nix | 49 |
2 files changed, 77 insertions, 55 deletions
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 = "<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" = { @@ -145,4 +181,3 @@ in { }; }; } - diff --git a/profiles/beryllium.nix b/profiles/beryllium.nix index 170dee2..7176dc4 100644 --- a/profiles/beryllium.nix +++ b/profiles/beryllium.nix @@ -48,7 +48,7 @@ in { primary = true; position = "0x0"; mode = "3840x2160"; - dpi = 331; + dpi = 156; rate = "60.00"; }; DP-0 = { @@ -56,7 +56,7 @@ in { primary = false; position = "3840x0"; mode = "3840x2160"; - dpi = 331; + dpi = 156; rate = "60.00"; }; in { @@ -66,40 +66,27 @@ in { inherit DP-2 DP-0; }; }; + portrait = { + inherit fingerprint; + config = { + DP-0 = DP-0 // { rotate = "left"; position = "2160x0"; }; + DP-2 = DP-2 // { rotate = "left"; }; + }; + }; }; services.random-background.enable = lib.mkForce true; services.polybar.enable = true; - services.polybar.config."bar/top".monitor = "DP-0"; + + services.polybar.config."bar/perf".monitor = "DP-0"; + services.polybar.config."bar/cpu".monitor = "DP-0"; + services.polybar.config."bar/cpu".bottom = true; + services.polybar.config."bar/org".monitor = "DP-2"; + services.polybar.script = '' - polybar top & - polybar second & + polybar perf & + polybar cpu & + polybar org & ''; - services.polybar.config."bar/second" = { - 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; - modules-center = "date"; - modules-left = ["ewmh" "volume-bar"]; - modules-right = [ "battery" "cpu" "mem" "temp" ]; - monitor = "DP-2"; - 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%"; - }; } - - |