{
config,
homeManagerModules,
pkgs,
lib,
...
}:
{
imports = with homeManagerModules.zaphyra; [
programs.networkManagerDmenu
programs.nmgui
];
programs.waybar = {
enable = true;
systemd.enable = true;
settings = [
{
layer = "top";
position = "top";
height = 26;
modules-left = [
"niri/workspaces"
"custom/arrow1"
];
modules-center = [
"clock"
"custom/notification"
];
modules-right = [
"tray"
"custom/arrow2"
"network"
"wireplumber"
"custom/airpodsctl"
"battery"
"niri/language"
];
"niri/workspaces" = {
format = "{index}: {value}";
};
"niri/language" = {
format = "{}";
format-en = "US";
format-de = "DE";
format-ru = "RU";
};
clock = {
on-click = "swaync-client -t -sw";
on-click-right = lib.getExe pkgs.gnome-calendar;
format = "{:%d. %b %H:%M}";
tooltip-format = "{:%x %T}";
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "";
dnd-notification = "";
dnd-none = "";
inhibited-notification = "";
dnd-inhibited-notification = "";
dnd-inhibited-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
tray = {
tooltip = false;
spacing = 10;
};
"network" =
let
format = [
"Interface: {ifname}"
"IP-Address: {ipaddr}/{cidr}"
"Gateway: {gwaddr}"
];
in
{
interval = 5;
# family = "ipv4_6";
# on-click = lib.getExe pkgs.networkmanager_dmenu;
on-click = lib.getExe pkgs.unstable.nmgui;
tooltip-format = lib.concatStringsSep "\n" format;
tooltip-format-wifi = lib.concatStringsSep "\n" (
format
++ [
""
"Signal strength: {signalStrength}% {signaldBm}dBm"
"Frequency: {frequency}Ghz"
]
);
format-ethernet = " ";
format-wifi = " {essid} ({signalStrength}%)";
format-linked = " ";
format-disconnected = " ";
};
wireplumber = {
max-volume = 150;
scroll-step = 1;
on-click = lib.concatStringsSep " " [
config.home.sessionVariables.TERMINAL
"--confirm-close-surface=false"
"-e"
(lib.getExe pkgs.ncpamixer)
];
format = "{icon} {volume}%";
format-muted = "";
format-icons = [
""
""
""
""
""
];
};
"custom/airpodsctl" = {
exec = "${lib.getExe pkgs.airpodsctl} --device=6C:12:70:1F:13:C6 --format=waybar --notify monitor";
return-type = "json";
format = " {icon} {percentage}%";
format-icons = [
""
""
""
""
""
""
""
""
""
""
""
];
};
battery = {
on-click = lib.getExe pkgs.gnome-power-manager;
interval = 10;
full-at = 99;
states = {
full = 100;
good = 99;
warning = 40;
critical = 15;
};
# Connected to AC
format = " {capacity}%";
# Not connected to AC
format-discharging = "{icon} {capacity}%";
format-icons = [
""
""
""
""
""
""
""
""
""
""
""
""
];
tooltip-format = "{power} W, {timeTo}";
};
"custom/arrow1" = {
format = "";
tooltip = false;
};
"custom/arrow2" = {
format = "";
tooltip = false;
};
}
];
style = ''
@keyframes blink {
to {
background: transparent;
color: #fff;
}
}
* {
font-family: "Adwaita Sans", "Symbols Nerd Font";
font-size: 14px;
border: none;
border-radius: 0;
min-height: 0;
transition: none;
box-shadow: none;
}
window#waybar {
color: white;
background: rgba(0, 0, 0, 0.5);
border-bottom: 2px solid rgba(59, 135, 86, 0.5);
}
#workspaces {
background: rgba(255, 255, 255, 0.06);
}
#workspaces button.focused {
background: rgba(255, 255, 255, 0.1);
border-bottom: 2px solid rgb(74, 169, 108);
}
#workspaces button:hover {
background: rgba(255, 255, 255, 0.06);
}
#clock {
font-size: 14px;
font-family: 'Noto Mono', monospace;
padding: 0px 5px;
}
#tray {
padding: 0px 15px;
}
#network, #wireplumber, #custom-airpodsctl, #battery, #language {
background: rgba(255, 255, 255, 0.06);
padding: 0px 15px;
}
#battery {
color: #a3be8c;
}
#battery.charging {
color: #a3be8c;
}
#battery.critical:not(.charging) {
background: rgba(245, 60, 60, 0.4);
color: #fff;
border-radius: 15px;
margin: 6px;
animation-name: blink;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#custom-arrow1, #custom-arrow2 {
font-size: 20pt;
color: rgba(255, 255, 255, 0.06);
}
'';
};
}