Files
nix-config/home/panotaka/common/optional/desktops/hyprland/waybar.nix
2025-08-26 09:21:24 -03:00

138 lines
4.0 KiB
Nix

{pkgs, ...}: {
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 30;
modules-left = ["hyprland/workspaces" "hyprland/mode" "hyprland/window"];
modules-center = ["clock"];
modules-right = ["network" "bluetooth" "pulseaudio" "battery" "tray" "custom/notification"];
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
format = "{icon}";
format-icons = {
"1" = "1";
"2" = "2";
"3" = "3";
"4" = "4";
"5" = "5";
"6" = "6";
"7" = "7";
"8" = "8";
"9" = "9";
"10" = "10";
};
};
"hyprland/mode" = {
format = "<span style=\"italic\">{}</span>";
};
"hyprland/window" = {
format = "{}";
max-length = 50;
separate-outputs = true;
};
"clock" = {
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = "{:%Y-%m-%d}";
format = "{:%H:%M}";
};
"network" = {
format-wifi = " {essid} ({signalStrength}%)";
format-ethernet = " {ipaddr}/{cidr}";
tooltip-format = " {ifname} via {gwaddr}";
format-linked = " {ifname} (No IP)";
format-disconnected = " Disconnected";
format-alt = "{ifname}: {ipaddr}/{cidr}";
};
"bluetooth" = {
format = " {status}";
format-disabled = "";
format-connected = " {device_alias}";
format-connected-battery = " {device_alias} {device_battery_percentage}%";
tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected";
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
};
"pulseaudio" = {
scroll-step = 5;
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}% ";
format-bluetooth-muted = " {icon}";
format-muted = " {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = ["" "" ""];
};
on-click = "pavucontrol";
};
"battery" = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = ["" "" "" "" ""];
};
"tray" = {
icon-size = 21;
spacing = 10;
show-passive-items = true;
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "<span foreground='red'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-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;
};
};
};
};
# Auto-start waybar with Hyprland
wayland.windowManager.hyprland.settings.exec-once = [
"waybar"
];
home.packages = with pkgs; [
waybar
libappindicator-gtk3
swaynotificationcenter
];
}