nixos/home/waybar/default.nix
2024-06-12 21:36:33 +02:00

93 lines
2.7 KiB
Nix

{pkgs, ...}: {
home.packages = with pkgs; [
pavucontrol
playerctl
];
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
default = {
layer = "top";
position = "top";
module-left = ["clock" "hyprland/workspaces" "wlr/taskbar"];
modules-center = ["custom/playerctl"];
modules-right = ["hyprland/language" "tray" "pulseaudio" "temperature" "battery"];
clock = {
format = "{:%Y-%m-%d}";
};
"hyprland/workspaces" = {
active-only = false;
all-outputs = true;
disable-scroll = false;
on-scroll-up = "hyprctl dispatch workspace -1";
on-scroll-down = "hyprctl dispatch workspace +1";
format = "{number}";
on-click = "activate";
sort-by = "number";
};
"custom/playerctl" = {
format = "{text}";
return-type = "json";
max-length = 64;
on-click-middle = "playerctl play-pause";
on-click = "playerctl previous";
on-click-right = "playerctl next";
format-icons = {
Playing = "<span foreground='#E5B9C6'>󰒮 󰐌 󰒭</span>";
Paused = "<span foreground='#928374'>󰒮 󰏥 󰒭</span>";
};
interval = 5;
exec = ''
playerctl -a metadata --format '{"text": "{{artist}} - {{markup_escape(title)}}", "tooltip": "{{playerName}} : {{markup_escape(title)}}", "alt": "{{status}}", "class": "{{status}}"}'
'';
};
pulseaudio = {
format = "<span font='Font Awesome 5 Free 11'>{icon:2}</span> {volume:4}% - {desc}";
format-bluetooth = "<span font='Font Awesome 5 Free 11'> {icon:2}</span> {volume:4}% - {desc}";
format-alt = "<span font='Font Awesome 5 Free 11'>{icon:2}</span> {volume:4}%";
format-alt-click = "click-right";
format-muted = "<span font='Font Awesome 5 Free 11'></span>";
format-icons = {
headphone = [" " " " " " " "];
default = ["" "" "" ""];
};
scroll-step = 2;
on-click = "pavucontrol";
tooltip = false;
};
"battery" = {
states = {
good = 90;
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {icon}{capacity}%";
format-plugged = " {capacity}%";
format-alt = "{icon} {time}";
format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
"tray": {
"icon-size" = 18;
"spacing" = 18;
};
};
};
};
}