{
pkgs,
lib,
config,
...
}:
let
cfg = config.py.gui;
in
{
config = {
xdg.configFile."waybar/mocha.css" = lib.mkIf cfg.enable {
source = ./waybar-mocha.css;
recursive = false;
};
catppuccin.waybar.enable = false;
programs.waybar = lib.mkIf cfg.enable {
enable = lib.mkDefault true;
systemd.enable = true;
systemd.target = "sway-session.target";
style = ./waybar-style.css;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [
"sway/workspaces"
"sway/mode"
];
modules-center = [ "mpris" ];
modules-right = [
"idle_inhibitor"
"wireplumber"
"network"
"temperature"
"backlight"
"battery"
"clock"
"tray"
];
"sway/workspaces" = {
disable-scroll = true;
enable-bar-scroll = false;
active-only = false;
all-outputs = false;
format = "{icon}";
};
"idle_inhibitor" = {
format = "{icon} ";
format-icons = {
"activated" = "";
"deactivated" = "";
};
};
"tray" = {
icon-size = 25;
spacing = 12;
};
"clock" = {
tooltip-format = "{calendar}";
format = " {:%H:%M:%S}";
format-alt = "{%d %b %Y}";
interval = 1;
calendar = {
format = {
today = "{}";
};
};
};
"cpu" = {
format = " {usage}%";
interval = 5;
tooltip = false;
};
"memory" = {
format = " {}%";
};
"temperature" = {
critical-threshold = 80;
format = "{icon} {temperatureC}°C";
format-icons = [
""
""
""
""
""
];
};
"backlight" = {
format = "{icon} {percent}%";
format-icons = [
""
""
""
""
""
""
""
];
};
"battery" = {
states = {
good = 65;
warning = 30;
critical = 15;
};
full-at = 80;
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = [
""
""
""
""
""
""
""
""
""
""
""
];
};
"network" = {
format-wifi = " {essid}";
format-ethernet = " {ifname}: {ipaddr}/{cidr}";
format-linked = " {ifname} (No IP)";
format-disconnected = "⚠ Disconnected!";
format-alt = "{ifname}: {ipaddr}/{cidr}";
on-click = lib.getExe pkgs.networkmanagerapplet;
};
"wireplumber" = {
format = "{icon} {volume}%";
format-muted = "";
format-icons = [
""
""
""
];
states = {
low = 15;
med = 40;
high = 60;
};
scroll-step = 5;
on-click = lib.getExe pkgs.pwvucontrol;
};
mpris = {
format = "{status_icon} {dynamic}";
max-length = 100;
format-paused = "{status_icon} {dynamic}";
dynamic-order = [
"artist"
"title"
];
status-icons = {
playing = "";
paused = "";
};
player-icons = {
firefox = "";
};
};
};
};
};
};
}