os/modules/graphical/waybar.nix

97 lines
2.8 KiB
Nix

{
lib,
config,
pkgs,
...
}:
with lib; let
psCfg = config.pub-solar;
in {
home-manager.users."${psCfg.user.name}" = {
programs.waybar = {
enable = true;
settings.main = {
layer = "top";
position = "top";
height = 32;
spacing = 16;
modules-left = ["sway/workspaces"];
modules-center = ["sway/mode"];
modules-right = ["network" "tray" "sway/language" "pulseaudio" "battery" "clock"];
"sway/workspaces".disable-scroll = true;
"sway/mode" = {
tooltip = false;
format = "{}";
};
"sway/window" = {
tooltip = false;
max-length = 96;
};
"sway/language" = {
format = "{}";
max-length = 2;
on-click = "${pkgs.toggle-kbd-layout}/bin/toggle-kbd-layout";
};
tray = {
icon-size = 16;
spacing = 16;
};
clock = {
tooltip-format = "<tt><small>{calendar}</small></tt>";
format-alt = "{:%a %d. %h %H:%M}";
calendar = {
mode-mon-col = "3";
on-scroll = "-1";
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
};
battery = {
tooltip = false;
states = {
critical = 20;
};
full-at = 90;
format = "<span font='12'>{icon}</span> {capacity}%";
format-icons = ["" "" "" "" ""];
};
network = {
interval = 3;
tooltip = true;
format-wifi = "{bandwidthUpBits} up | {bandwidthDownBits} down";
format-ethernet = "{bandwidthUpBits} up | {bandwidthDownBits} down";
format-disconnected = "no network";
tooltip-format-wifi = "{essid} ({signalStrength}%) {ipaddr}";
tooltip-format-ethernet = "{ifname} {ipaddr}";
};
pulseaudio = {
tooltip = false;
format = "<span font='12'>{icon}</span> {volume}%";
format-bluetooth = "<span font='12'>{icon}</span> {volume}%";
format-muted = "<span font='12'>{icon}x</span>";
on-click = "pavucontrol";
format-icons = {
headphones = "";
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = ["" "" ""];
};
};
};
style = builtins.readFile ./.config/waybar/style.css;
systemd.enable = true;
systemd.target = "sway-session.target";
};
};
}