{ pkgs, lib, config, ... }:
{
options = {
waybar.enable = lib.mkEnableOption "enable waybar";
};
config = lib.mkIf config.waybar.enable {
programs.waybar = {
enable = true;
systemd.enable = true;
style =
with config.lib.stylix.colors.withHashtag;
''
@define-color base00 ${base00}; @define-color base01 ${base01}; @define-color base02 ${base02}; @define-color base03 ${base03};
@define-color base04 ${base04}; @define-color base05 ${base05}; @define-color base06 ${base06}; @define-color base07 ${base07};
@define-color base08 ${base08}; @define-color base09 ${base09}; @define-color base0A ${base0A}; @define-color base0B ${base0B};
@define-color base0C ${base0C}; @define-color base0D ${base0D}; @define-color base0E ${base0E}; @define-color base0F ${base0F};
'' + builtins.readFile ./attachments/waybar-style.css;
settings = {
bar = {
layer = "top";
height = 30;
spacing = 8;
margin-down = 5;
modules-left = ["hyprland/workspaces"];
modules-center = ["clock"];
modules-right = ["network" "custom/vpn" "memory" "backlight" "pulseaudio" "hyprland/language" "tray" "battery"];
"hyprland/workspaces" = {
format = "{icon}";
"format-icons" = {
"1" = "α";
"2" = "β";
"3" = "γ";
"4" = "δ";
"5" = "ε";
urgent = "λ";
focused = "σ";
default = "ω";
};
};
"hyprland/language" = {
format = "{} ";
format-ru = "ru";
format-en = "en";
};
"tray" = {
spacing = 10;
};
"clock" = {
format = "{:%H:%M }";
tooltip-format = "{:%Y %B}\n{calendar}";
format-alt = "{:%d %h %Y }";
};
"memory" = {
format = "{}% ";
};
"backlight" = {
format = "{percent}% {icon}";
format-icons = ["" "" ""];
};
"battery" = {
"states" = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-alt = "{icon}";
format-icons = ["" "" "" "" "" "" "" "" "" ""];
};
"network" = {
interface = "wlp*";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
tooltip-format = "{ifname} via {gwaddr} ";
format-linked = "{ifname} (No IP) ";
format-disconnected = "";
};
"custom/vpn" = {
format = "{text}";
exec = "${./attachments/hypr-scripts/toggle-vpn.sh} waybar";
return-type = "json";
};
"pulseaudio" = {
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {format_source}";
format-bluetooth-muted = " {format_source}";
format-muted = " {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
"format-icons" = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
muted-icon = "";
default = ["" "" ""];
};
};
};
};
};
};
}