{
config,
pkgs,
stylix,
osConfig,
...
}: let
networkInterface.eth =
if osConfig.networking.hostName == "voyager"
then "wlan0"
else if osConfig.networking.hostName == "nixbox"
then "enp6s0"
else "";
colors = config.lib.stylix.colors.withHashtag;
primaryColor = colors.base04;
altColor = colors.base0C;
in {
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
});
settings = {
mainBar = {
layer = "top";
position = "top";
height = 36;
spacing = 8;
margin = "0px 0px 5px 0px";
modules-left = ["hyprland/workspaces"];
modules-right = ["network" "cpu" "memory" "disk" "pulseaudio" "battery" "clock"];
"hyprland/workspaces" = {
sort-by-number = true;
on-click = "activate";
format = "{icon}";
persistent-workspaces = {
"1" = "[]";
"2" = "[]";
"3" = "[]";
"4" = "[]";
};
format-icons = {
"urgent" = "";
"active" = "";
"default" = "";
};
};
"clock" = {
"format" = " {:%a, %b %d, %Y %R}";
"tooltip-format" = "{calendar}";
"calendar" = {
"mode" = "year";
"mode-mon-col" = 3;
"weeks-pos" = "right";
"on-scroll" = 1;
"on-click-right" = "mode";
"format" = {
"months" = "{}";
"days" = "{}";
"weeks" = "W{}";
"weekdays" = "{}";
"today" = "{}";
};
};
"actions" = {
"on-click-right" = "mode";
"on-scroll-up" = "shift_up";
"on-scroll-down" = "shift_down";
};
};
"cpu" = {
"interval" = 2;
"format" = "CPU: {usage}% @ {avg_frequency}GHz";
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.bottom}/bin/btm";
};
"battery" = {
"bat" = "macsmc-battery";
"format" = "Battery: {capacity}% (P)";
"format-charging" = "Battery: {capacity}% (C)";
"format-discharging" = "Battery: {capacity}% (D)";
};
"memory" = {
"format" = "RAM: {used:0.1f}G/{total:0.1f}G";
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.bottom}/bin/btm";
};
"disk" = {
"format" = "Disk: {used}/{total}";
"path" = "/";
};
"network" = {
"interface" = "${networkInterface.eth}";
"interval" = 2;
"format-ethernet" = "Ether: Up: {bandwidthUpBits} Down: {bandwidthDownBits} ";
"tooltip-format-ethernet" = "{ifname}";
"format-wifi" = "WiFi: Up: {bandwidthUpBits} Down: {bandwidthDownBits} ({signalStrength}%)";
"tooltip-format-wifi" = "{essid} ({signalStrength}%)";
"format-disconnected" = "Disconnected";
"on-click" = "${pkgs.alacritty}/bin/alacritty -e ${pkgs.iwd}/bin/iwctl";
};
"pulseaudio" = {
"format" = "Volume: {volume}%";
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
};
};
};
};
}