Add dunst to waybar

This commit is contained in:
Erwin Boskma 2022-03-21 16:50:28 +01:00
parent 03f5c909a3
commit d362336f6f
Signed by: erwin
GPG key ID: 270B20D17394F7E5

View file

@ -6,6 +6,14 @@
}:
with lib; let
cfg = config.eboskma.programs.waybar;
wb-dunst = pkgs.writeShellScriptBin "wb-dunst" ''
COUNT=$(${pkgs.dunst}/bin/dunstctl count waiting)
ENABLED=" "
DISABLED=" "
if [[ ''${COUNT} != 0 ]]; then DISABLED=" ''${COUNT}"; fi
if ${pkgs.dunst}/bin/dunstctl is-paused | grep -q "false" ; then echo "''${ENABLED}"; else echo "''${DISABLED}"; fi
'';
in {
options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar";
@ -37,6 +45,7 @@ in {
"clock#date"
"clock#time"
"idle_inhibitor"
"custom/dunst"
];
modules = {
"clock#time" = {
@ -112,16 +121,6 @@ in {
disable-scroll = true;
format = "{icon} {name}";
format-icons = {
"1 =www" = "";
# Icon = firefox-browser
"2 =mail" = "";
# Icon = mail
"3 =editor" = "";
# Icon = code
"4 =terminals" = "";
# Icon = terminal
"5 =portal" = "";
# Icon = terminal
"urgent" = "";
"focused" = "";
"default" = "";
@ -171,6 +170,11 @@ in {
deactivated = "";
};
};
"custom/dunst" = {
exec = "${wb-dunst}/bin/wb-dunst";
on-click = "${pkgs.dunst}/bin/dunstctl set-paused toggle";
restart-interval = 1;
};
};
}
];
@ -351,6 +355,7 @@ in {
#idle_inhibitor {
background-color: transparent;
font-weight: bold;
padding-right: 10px;
}
#idle_inhibitor.activated {
@ -361,6 +366,10 @@ in {
#custom-now_playing {
font-weight: bold;
}
#custom-dunst {
padding: 0 10px;
}
'';
};
};