configuration.nix/home/sway/waybar/default.nix
2023-03-25 22:10:09 +05:30

104 lines
3 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
pkgs,
...
}: {
programs.waybar.enable = true;
programs.waybar.systemd.enable = true;
programs.waybar.style = ./style.css;
xdg.configFile."waybar/colors.css".source = ./colors.css;
programs.waybar.settings = {
mainBar = {
layer = "top";
position = "top";
height = 28;
modules-left = ["sway/workspaces" "sway/window" "sway/mode"];
modules-center = [];
modules-right = ["tray" "custom/power_profile" "idle_inhibitor" "network" "bluetooth" "pulseaudio" "backlight" "battery" "clock"];
"sway/mode" = {
"format" = "{}";
};
"sway/window" = {
"tooltip" = false;
};
"idle_inhibitor" = {
"format" = "{icon}";
"format-icons" = {
"activated" = "";
"deactivated" = "";
};
"tooltip" = false;
};
"clock" = {
"tooltip" = false;
"interval" = 1;
"format" = "{:%I:%M}";
"format-alt" = "{:%d %B %Y, %A}";
};
"backlight" = {
"format" = "{icon}";
"format-icons" = ["" "" "" ""];
};
"battery" = {
"states" = {
"good" = 90;
"warning" = 20;
"critical" = 10;
};
"format" = "{icon}";
"format-alt" = "{icon} {capacity}% ({time})";
"format-charging" = " {capacity}%";
"format-plugged" = " {capacity}%";
"format-icons" = ["" "" "" "" "" "" "" "" "" "" ""];
"tooltip" = false;
};
"network" = {
"format-wifi" = "";
"format-ethernet" = "";
"format-linked" = "";
"format-disconnected" = "";
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
"tooltip" = false;
};
"pulseaudio" = {
"tooltip" = false;
"format" = "{icon} {format_source}";
"format-muted" = " {format_source}";
"format-bluetooth" = " {icon} {format_source}";
"format-bluetooth-muted" = " {format_source}";
"format-source" = "";
"format-source-muted" = "";
"format-icons" = {
"headphones" = "";
"handsfree" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" "奔" ""];
};
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
};
"bluetooth" = {
"format" = "";
"format-connected" = "";
"format-disabled" = "";
"format-off" = "";
"format-connected-battery" = " {device_battery_percentage}%";
"on-click" = "${pkgs.blueman}/bin/blueman-manager";
};
"tray" = {
"spacing" = 4;
};
"custom/power_profile" = let
script = "${config.xdg.configHome}/scripts/power_profile.sh";
in {
exec = "${script} icon";
on-click = "${script} toggle";
format = "{}";
tooltip = false;
interval = "10";
};
};
};
}