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:
parent
cb01ed1152
commit
2f1ae3b872
2 changed files with 24 additions and 13 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue