diff --git a/modules/mako/testbeds/mako.nix b/modules/mako/testbeds/mako.nix index fcdf169e..b020b1b0 100644 --- a/modules/mako/testbeds/mako.nix +++ b/modules/mako/testbeds/mako.nix @@ -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 { diff --git a/stylix/testbed/modules/application.nix b/stylix/testbed/modules/application.nix index d25716e9..bab7e5eb 100644 --- a/stylix/testbed/modules/application.nix +++ b/stylix/testbed/modules/application.nix @@ -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;