flocon/home/programs/ironbar.nix

112 lines
2.6 KiB
Nix
Raw Normal View History

2024-11-16 22:00:45 +00:00
{
config,
2024-11-16 22:00:45 +00:00
lib,
inputs,
...
}: let
inherit (lib) mkIf;
2024-11-16 22:00:45 +00:00
icon_size = 28;
in {
imports = [
./swaync.nix
inputs.ironbar.homeManagerModules.default
];
2024-11-13 22:19:57 +00:00
programs.ironbar = {
enable = true;
systemd = true;
config = {
position = "top";
anchor_to_edges = true;
2024-11-16 22:00:45 +00:00
start = [
{
bar = [
{
label = "";
name = "power-btn";
on_click = "popup:toggle";
type = "button";
}
];
class = "power-menu";
popup = [
{
orientation = "vertical";
type = "box";
widgets = [
{
label = "Power menu";
name = "header";
type = "label";
}
{
type = "box";
widgets = [
{
class = "power-btn";
label = "<span font-size='40pt'></span>";
on_click = "!shutdown now";
type = "button";
}
{
class = "power-btn";
label = "<span font-size='40pt'></span>";
on_click = "!reboot";
type = "button";
}
];
}
{
label = "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}";
name = "uptime";
type = "label";
}
];
}
];
tooltip = "Up: {{30000:uptime -p | cut -d ' ' -f2-}}";
type = "custom";
}
];
2024-11-13 22:19:57 +00:00
center = [
{
2024-11-16 22:00:45 +00:00
inherit icon_size;
2024-11-13 22:19:57 +00:00
type = "focused";
show_icon = true;
show_title = true;
truncate = "end";
}
];
end = [
2024-11-16 22:00:45 +00:00
{
type = "upower";
format = "{percentage}%";
}
2024-11-13 22:19:57 +00:00
{type = "clock";}
2024-11-16 22:00:45 +00:00
{
type = "tray";
inherit icon_size;
}
(mkIf
config.services.swaync.enable
{
type = "notifications";
"show_count" = true;
icons = {
"closed_none" = "󰍥";
"closed_some" = "󱥂";
"closed_dnd" = "󱅯";
"open_none" = "󰍡";
"open_some" = "󱥁";
"open_dnd" = "󱅮";
};
})
2024-11-13 22:19:57 +00:00
];
};
style = ''
.tray .item {
2024-11-16 22:00:45 +00:00
min-width: 40px;
}
2024-11-13 22:19:57 +00:00
'';
};
}