home/programs/ironbar: add swaync

This commit is contained in:
Anthony Rodriguez 2024-11-16 23:00:45 +01:00
parent e4fcd210a2
commit 8155033b48
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -1,36 +1,145 @@
{inputs, ...}: { {
lib,
inputs,
pkgs,
...
}: let
inherit (lib) mkForce;
icon_size = 28;
in {
imports = [inputs.ironbar.homeManagerModules.default]; imports = [inputs.ironbar.homeManagerModules.default];
home.packages = [pkgs.procps];
services.swaync = {
enable = true;
settings = {
positionX = "right";
positionY = "top";
layer = "overlay";
control-center-layer = "top";
layer-shell = true;
cssPriority = "application";
control-center-margin-top = 0;
control-center-margin-bottom = 0;
control-center-margin-right = 0;
control-center-margin-left = 0;
notification-2fa-action = true;
notification-inline-replies = false;
notification-icon-size = 64;
notification-body-image-height = 100;
notification-body-image-width = 200;
};
};
systemd.user.services.swaync = {
Install.WantedBy = mkForce ["graphical-session.target"];
Unit.ConditionEnvironment = mkForce "";
Unit.PartOf = lib.mkForce ["graphical-session.target"];
};
programs.ironbar = { programs.ironbar = {
enable = true; enable = true;
systemd = true; systemd = true;
config = { config = {
position = "top"; position = "top";
anchor_to_edges = true; anchor_to_edges = true;
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";
}
];
center = [ center = [
{ {
inherit icon_size;
type = "focused"; type = "focused";
show_icon = true; show_icon = true;
show_title = true; show_title = true;
icon_size = 20;
truncate = "end"; truncate = "end";
} }
]; ];
end = [ end = [
{type = "volume";} {
type = "upower";
format = "{percentage}%";
}
{
type = "volume";
format = "{icon} {percentage}%";
max_volume = 100;
icons = {
volume_high = "󰕾";
volume_medium = "󰖀";
volume_low = "󰕿";
muted = "󰝟";
};
}
{type = "clock";} {type = "clock";}
{type = "tray";} {
type = "tray";
inherit icon_size;
}
{
type = "notifications";
"show_count" = true;
icons = {
"closed_none" = "󰍥";
"closed_some" = "󱥂";
"closed_dnd" = "󱅯";
"open_none" = "󰍡";
"open_some" = "󱥁";
"open_dnd" = "󱅮";
};
}
]; ];
}; };
style = '' style = ''
.tray {
margin-top: 5px;
padding: 10px;
border-radius: 50px;
}
.tray .item { .tray .item {
border-radius: 50px; min-width: 40px;
min-height: 25px; }
padding: 0;
''; '';
}; };
} }