dotfiles/modules/desktop/addons/waybar/default.nix

152 lines
4.3 KiB
Nix
Raw Normal View History

2023-03-19 15:16:10 +00:00
{
options,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.aa.desktop.addons.waybar;
in {
options.aa.desktop.addons.waybar = with types; {
enable = mkEnableOption "waybar";
};
config = mkIf cfg.enable {
2023-05-28 02:25:52 +00:00
aa.system.fonts.enable = true;
2023-03-19 15:16:10 +00:00
aa.home = {
extraOptions = {
programs.waybar = {
enable = true;
systemd.enable = true;
style = builtins.readFile ./waybar_style.css;
settings = [
{
layer = "top";
position = "bottom";
2023-03-19 15:16:10 +00:00
height = 20;
modules-left = ["sway/workspaces"];
modules-center = ["clock"];
modules-right = [
"idle_inhibitor"
"temperature"
"cpu"
"pulseaudio"
"battery"
"memory"
"backlight"
"network"
"tray"
];
"sway/workspaces" = {
disable-scroll = false;
all-outputs = true;
format = "{icon}";
format-icons = {
"1" = "q";
"2" = "w";
"3" = "e";
"4" = "r";
"5" = "t";
"6" = "y";
"7" = "u";
"8" = "i";
"9" = "o";
urgent = " ";
focused = " ";
default = " ";
};
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = " ";
deactivated = " ";
};
};
temperature = {
critical-threshold = 80;
2023-06-10 00:39:40 +00:00
format = "{icon}{temperatureC}°C";
2023-03-19 15:16:10 +00:00
format-icons = [" " " " " "];
};
cpu = {
2023-06-10 00:39:40 +00:00
format = " {usage}%";
2023-03-19 15:16:10 +00:00
tooltip = false;
};
pulseaudio = {
format = "{icon} {volume}% {format_source}";
format-bluetooth = "{icon} {volume}% {format_source}";
format-bluetooth-muted = " {volume}% {format_source}";
format-muted = " {format_source}";
format-source = " ";
format-source-muted = " ";
format-icons = {
headphone = " ";
hands-free = " ";
headset = " ";
phone = " ";
portable = " ";
car = " ";
default = [" " " " " "];
};
tooltip-format = "{desc}, {volume}%";
# TODO: Figure out how to get pactl binary?
on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
on-click-right = "pactl set-source-mute @DEFAULT_SOURCE@ toggle";
on-click-middle = "pavucontrol";
};
battery = {
states = {
warning = 30;
critical = 1;
};
format = "{icon} {capacity}%";
tooltip-format = "{timeTo}, {capacity}%";
2023-06-05 05:52:14 +00:00
format-charging = "󰂄 {capacity}%";
2023-03-19 15:16:10 +00:00
format-plugged = " ";
format-alt = "{time} {icon}";
2023-06-10 00:39:40 +00:00
format-icons = [" " " " " " " " " "];
2023-03-19 15:16:10 +00:00
};
memory = {
2023-06-10 00:39:40 +00:00
format = " {}%";
2023-03-19 15:16:10 +00:00
};
backlight = {
format = "{icon} {percent}%";
2023-06-10 00:39:40 +00:00
format-icons = ["󰃞`" "󰃚"];
2023-03-19 15:16:10 +00:00
on-scroll-up = "light -A 1";
on-scroll-down = "light -U 1";
};
network = {
2023-06-10 00:39:40 +00:00
format-wifi = " ";
2023-05-28 02:25:52 +00:00
format-ethernet = "{ifname}: {ipaddr}/{cidr} 󰈀 ";
2023-03-19 15:16:10 +00:00
format-linked = "{ifname} (No IP) ";
format-disconnected = " ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format = "{essid} {signalStrength}%";
};
tray = {
spacing = 10;
};
}
];
};
wayland.windowManager.sway.config.bars = [];
};
};
};
}