stylix/testbed: add sendNotifications option (#1770)

Link: https://github.com/nix-community/stylix/pull/1770

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
awwpotato 2025-07-27 10:05:26 -07:00 committed by GitHub
parent cb01ed1152
commit 2f1ae3b872
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 13 deletions

View file

@ -1,19 +1,8 @@
{ lib, pkgs, ... }:
{ lib, ... }:
{
stylix.testbed.ui = {
# We use Hyprland because Gnome has its own notification daemon
graphicalEnvironment = "hyprland";
command.text =
# Run as a single command to ensure the same order between executions
lib.concatMapStringsSep " && "
(
urgency: "${lib.getExe pkgs.libnotify} --urgency ${urgency} ${urgency} urgency"
)
[
"low"
"normal"
"critical"
];
sendNotifications = true;
};
home-manager.sharedModules = lib.singleton {

View file

@ -84,6 +84,7 @@ in
);
default = null;
};
sendNotifications = lib.mkEnableOption "sending notifications of each urgency with libnotify";
};
}
);
@ -111,6 +112,27 @@ in
};
}
)
++ lib.optional config.stylix.testbed.ui.sendNotifications (
pkgs.makeAutostartItem {
name = "stylix-notification-check";
package = pkgs.makeDesktopItem {
name = "stylix-notification-check";
desktopName = "stylix-notification-check";
terminal = false;
exec = pkgs.writeShellScript "stylix-send-notifications" (
lib.concatMapStringsSep " && "
(
urgency: "${lib.getExe pkgs.libnotify} --urgency ${urgency} ${urgency} urgency"
)
[
"low"
"normal"
"critical"
]
);
};
}
)
++ lib.optional (config.stylix.testbed.ui.application != null) (
pkgs.makeAutostartItem {
inherit (config.stylix.testbed.ui.application) name package;