From 0a3df54053439f76c1d6ef1cf44b0df767b13c3e Mon Sep 17 00:00:00 2001 From: Talha Can Havadar Date: Thu, 14 Nov 2024 18:59:04 +0100 Subject: [PATCH] aerospace: fix on-window-detected --- modules/services/aerospace/default.nix | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/services/aerospace/default.nix b/modules/services/aerospace/default.nix index 50d47b3b5..1b1ed8d02 100644 --- a/modules/services/aerospace/default.nix +++ b/modules/services/aerospace/default.nix @@ -10,6 +10,20 @@ let format = pkgs.formats.toml { }; configFile = format.generate "aerospace.toml" cfg.settings; + callbackConf = + with lib.types; + oneOf [ + bool + int + float + str + path + attrs + ] + // { + description = "AeroSpace config callback (bool, int, float, str, path or attrs)"; + }; + in { @@ -71,9 +85,17 @@ in description = "Default orientation for the root container."; }; on-window-detected = lib.mkOption { - type = listOf str; + type = listOf (attrsOf (either callbackConf (listOf callbackConf))); default = [ ]; description = "Commands to run every time a new window is detected."; + example = [ + { + "if".app-id = "Another.Cool.App"; + "if".during-aerospace-startup = false; + "check-further-callbacks" = false; + "run" = "move-node-to-workspace m"; + } + ]; }; on-focus-changed = lib.mkOption { type = listOf str;