{ config, lib, ... }:
let
cfg = config.programs.waybar;
cfgs = cfg.settings.mainBar;
in
{
programs.waybar = {
systemd.enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 26;
modules-left = [ "hyprland/workspaces" ];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
"network"
"pulseaudio"
"clock#date"
"clock"
];
"hyprland/workspaces" = {
persistent-workspaces = {
"*" = 8;
};
};
"hyprland/window" = {
"format" = "{initialTitle}";
};
tray = {
spacing = 10;
};
clock = {
"tooltip-format" = "{:%Y %B}\n{calendar}";
format = " {:%H:%M:%S}";
"format-alt" = " {:%Y-%m-%d}";
interval = 1;
};
"clock#date" = {
format = " {:%d.%m.%Y}";
"tooltip-format" = "{:%Y %B}\n{calendar}";
};
"battery" = {
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{icon} {capacity}%";
"format-charging" = " {capacity}%";
"format-plugged" = " {capacity}%";
"format-icons" = [
""
""
""
""
""
];
"on-click" = "ags -t quicksettings";
};
"pulseaudio" = {
"format" = "{icon} {volume}% {format_source}";
"format-bluetooth" = " {icon} {volume}% {format_source}";
"format-bluetooth-muted" = " {icon} {format_source}";
"format-muted" = " {format_source}";
"format-source" = "";
"format-source-muted" = "";
"format-icons" = {
"default" = [
""
""
""
];
};
"on-click" = "pavucontrol";
};
"network" = {
"format-wifi" = " {essid}";
"format-ethernet" = "⬇{bandwidthDownBytes} ⬆{bandwidthUpBytes}";
"interval" = 3;
"format-linked" = "{ifname} (No IP) ";
"format" = "";
"format-disconnected" = "";
"on-click" = "alacritty -e nmtui";
"tooltip-format" = " {bandwidthUpBits} {bandwidthDownBits}\n{ifname}\n{ipaddr}/{cidr}\n";
"tooltip-format-wifi" =
" {essid} {frequency}MHz\nStrength: {signaldBm}dBm ({signalStrength}%)\nIP: {ipaddr}/{cidr}\n {bandwidthUpBits} {bandwidthDownBits}";
"min-length" = 10;
"max-length" = 17;
};
};
};
style =
let
c = config.colors.defaultColorSet;
in
''
/*
*
* Catppuccin Mocha palette
* Maintainer: rubyowo
*
*/
@define-color background #1e1e2e;
@define-color foreground #cdd6f4;
@define-color mantle #181825;
@define-color crust #11111b;
@define-color subtext0 #a6adc8;
@define-color subtext1 #bac2de;
@define-color surface0 #313244;
@define-color surface1 #45475a;
@define-color surface2 #585b70;
@define-color overlay0 #6c7086;
@define-color overlay1 #7f849c;
@define-color overlay2 #9399b2;
@define-color blue #89b4fa;
@define-color lavender #b4befe;
@define-color sapphire #74c7ec;
@define-color sky #89dceb;
@define-color teal #94e2d5;
@define-color green #a6e3a1;
@define-color yellow #f9e2af;
@define-color peach #fab387;
@define-color maroon #eba0ac;
@define-color red #f38ba8;
@define-color mauve #cba6f7;
@define-color pink #f5c2e7;
@define-color flamingo #f2cdcd;
@define-color rosewater #f5e0dc;
* {
font-family: "Hack Nerd Font";
font-size: 14px;
min-height: 0;
font-weight: normal;
}
window#waybar {
background: transparent;
background-color: @background;
color: @foreground;
transition-property: background-color;
transition-duration: 0.1s;
}
#window {
margin: 2;
padding-left: 8;
padding-right: 8;
}
button {
box-shadow: inset 0 -3px transparent;
border: none;
border-radius: 0;
}
button:hover {
background: inherit;
border-top: 2px solid @hover;
}
#workspaces button {
padding: 0 4px;
color: gray;
font-weight: 300;
}
#workspaces button.empty {
color: #404040;
font-weight: 100;
}
#workspaces button.active {
background-color: rgba(0, 0, 0, 0.3);
color: white;
border-top: 2px solid @blue;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#pulseaudio,
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#wireplumber,
#tray,
#mode,
#scratchpad {
margin-left: 4px;
margin-right: 4px;
padding-left: 4px;
padding-right: 4px;
}
#clock {
color: @maroon;
border-bottom: 2px solid @maroon;
}
#clock.date {
color: @mauve;
border-bottom: 2px solid @mauve;
}
#pulseaudio {
color: @blue;
border-bottom: 2px solid @blue;
}
#network {
color: @yellow;
border-bottom: 2px solid @yellow;
}
#idle_inhibitor {
margin-right: 12px;
color: #7cb342;
}
#idle_inhibitor.activated {
color: @red;
}
#battery.charging,
#battery.plugged {
color: @green;
border-bottom: 2px solid @green;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left>widget:first-child>#workspaces {
margin-left: 0;
}
'';
};
systemd.user.services.waybar = lib.mkIf (cfg.enable && cfg.systemd.enable) {
Service.Environment = [
"DISPLAY=:0"
];
};
}