flocon/config/home-manager/programs/waybar/default.nix

188 lines
4.8 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
...
2024-12-19 17:59:03 +00:00
}: {
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
2024-12-19 17:59:03 +00:00
mainBar = {
layer = "top";
position = "top";
2024-12-19 17:59:03 +00:00
modules-left = [
"hyprland/window"
"pulseaudio"
"cpu"
"memory"
"idle_inhibitor"
];
2024-12-19 17:59:03 +00:00
modules-center = ["hyprland/workspaces"];
modules-right = [
"custom/swaync"
"custom/power"
"network"
"battery"
"tray"
"clock"
];
2024-12-19 17:59:03 +00:00
tray = {
icon-size = 16;
spacing = 12;
};
2024-12-19 17:59:03 +00:00
battery = {
interval = 10;
states = {
warning = 30;
critical = 15;
};
2024-12-19 17:59:03 +00:00
format = "{icon} {capacity}%";
format-charging = " {capacity}% - {time}";
format-full = " {capacity}% - Full";
format-icons = [
""
""
""
""
""
];
max-length = 25;
};
2024-12-19 17:59:03 +00:00
"pulseaudio" = {
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "";
2024-12-19 17:59:03 +00:00
format-icons = {
"alsa_output.pci-0000_00_1f.3.analog-stereo" = "";
"alsa_output.pci-0000_00_1f.3.analog-stereo-muted" = "";
headphone = "";
hands-free = "";
headset = "";
phone = "";
phone-muted = "";
portable = "";
car = "";
default = [
""
""
];
};
2024-12-19 17:59:03 +00:00
scroll-step = 1;
on-click = "pavucontrol";
ignored-sinks = [
"Easy Effects Sink"
];
};
2024-12-19 17:59:03 +00:00
"power-profiles-daemon" = {
format-icons = {
default = "";
performance = "";
balanced = "";
power-saver = "";
};
2024-12-19 17:59:03 +00:00
};
2024-12-19 17:59:03 +00:00
"custom/power" = {
format = "";
tooltip = false;
on-click = lib.getExe pkgs.wlogout;
};
2024-12-19 17:59:03 +00:00
"memory" = {
interval = 5;
format = " {}%";
2024-12-19 17:59:03 +00:00
tooltip = true;
};
2024-12-19 17:59:03 +00:00
"cpu" = {
interval = 5;
format = " {usage:2}%";
2024-12-19 17:59:03 +00:00
tooltip = true;
};
2024-12-19 17:59:03 +00:00
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
2024-12-19 17:59:03 +00:00
tooltip = "true";
};
2024-12-19 17:59:03 +00:00
"clock" = {
format = " {:L%H:%M}";
tooltip = true;
tooltip-format = "<big>{:%A, %d.%B %Y }</big>\n<tt><small>{calendar}</small></tt>";
};
2024-12-19 17:59:03 +00:00
"network" = {
format-icons = [
"󰤯"
"󰤟"
"󰤢"
"󰤥"
"󰤨"
];
format-ethernet = " {bandwidthDownOctets}";
format-wifi = "{icon} {signalStrength}%";
format-disconnected = "󰤮";
tooltip = false;
on-click = "XDG_CURRENT_DESKTOP=gnome gnome-control-center";
2024-12-19 17:59:03 +00:00
};
2024-12-19 17:59:03 +00:00
"hyprland/window" = {
max-length = 22;
separate-outputs = false;
};
"hyprland/workspaces" = {
format = "{name}";
format-icons = {
default = " ";
active = " ";
urgent = " ";
};
2024-12-19 17:59:03 +00:00
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
};
"custom/swaync" = {
tooltip = false;
format = "<big>{icon}</big>";
format-icons = {
none = "";
2024-12-19 17:59:03 +00:00
notification = "<span foreground='red'><sup></sup></span>";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = "";
};
2024-12-19 17:59:03 +00:00
return-type = "json";
escape = true;
exec-if = "which ${pkgs.swaynotificationcenter}/bin/swaync-client";
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client --subscribe-waybar";
on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait";
on-click-middle = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait";
};
};
};
};
systemd.user.services.waybar = {
Unit.After = lib.mkForce "graphical-session.target";
Service.Slice = "app-graphical.slice";
};
home.packages = [
pkgs.pavucontrol
];
}