nix-config/home/desktop-sway/waybar.nix

151 lines
3.8 KiB
Nix

{ config, pkgs, ... }:
{
programs.waybar = {
enable = true;
settings = [
{
modules-left = [ "sway/workspaces" ];
modules-center = [ "sway/window" ];
modules-right = [ "tray" "pulseaudio" "battery" "network" "clock" ];
modules = {
clock.format = "{: %m/%d <span color=\"#a89984\">|</span> %H:%M}";
network = {
format-icons = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
];
format = "({ifname})";
format-wifi = "{icon} {signalStrength}";
format-disconnected = "<span color=\"#a89974\"></span>";
format-ethernet = "";
};
battery = {
states = {
good = 95;
warning = 50;
critical = 20;
};
format-icons = {
discharging = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
]; # 
charging = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
]; # 
};
format = " {capacity}";
format-full = "";
format-good-charging = "";
format-plugged = "";
format-charging = "{icon} {capacity}";
format-discharging = "{icon} {capacity} ({time})";
interval = 5;
};
pulseaudio = {
states = {
high = 101;
very_high = 111;
};
format-icons = [
"<span color=\"#a89974\"></span>"
"<span color=\"#83a587\">奔</span>"
"<span color=\"#b8bb26\"></span>"
];
format = "{icon} {volume}";
format-bluetooth = "{icon} {volume}";
format-muted = "";
};
tray.icon-size = 14;
};
}
];
style = ''
* {
border-radius: 0px;
border: none;
font-family: Inter, "mplus Nerd Font";
font-size: 13px;
min-height: 0;
}
window#waybar {
background-color: #282828;
color: #ebdbb2;
}
#workspaces {
padding: 0px;
margin: 0px;
}
#workspaces button {
padding: 0px;
margin: 0px;
background: transparent;
}
#window {
color: #fbf1c7;
padding-left: 10px;
padding-right: 10px;
}
#workspaces button.focused {
background-color: #458588;
color: #fbf1c7;
}
#tray,
#pulseaudio,
#battery,
#network,
#cpu,
#memory,
#clock {
color: #fbf1c7;
padding-left: 5px;
padding-right: 5px;
}
#tray,
#pulseaudio,
#battery,
#cpu,
#memory,
#network {
border-right: 1px solid #a89984;
}
#pulseaudio.high {
color: #fabd2f;
}
#pulseaudio.very_high {
color: #fb4944;
}
#pulseaudio.muted {
color: #a8997a;
}
'';
systemd.enable = true;
};
}