Skip to content

Commit

Permalink
Merge pull request #1213 from z0al/aerospace-startup-commands
Browse files Browse the repository at this point in the history
fix(aerospace): allow startup commands
  • Loading branch information
Enzime authored Dec 4, 2024
2 parents e7a71f8 + 55d46b8 commit 55d0781
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
7 changes: 2 additions & 5 deletions modules/services/aerospace/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ in
after-startup-command = lib.mkOption {
type = listOf str;
default = [ ];
description = "Do not use AeroSpace to run commands after startup. (Managed by launchd instead)";
description = "Add commands that run after AeroSpace startup";
example = [ "layout tiles" ];
};
enable-normalization-flatten-containers = lib.mkOption {
type = bool;
Expand Down Expand Up @@ -142,10 +143,6 @@ in
assertion = cfg.settings.after-login-command == [ ];
message = "AeroSpace will not run these commands as it does not start itself.";
}
{
assertion = cfg.settings.after-startup-command == [ ];
message = "AeroSpace will not run these commands as it does not start itself.";
}
];
environment.systemPackages = [ cfg.package ];

Expand Down
13 changes: 12 additions & 1 deletion tests/services-aerospace.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ in
services.aerospace.enable = true;
services.aerospace.package = aerospace;
services.aerospace.settings = {
after-startup-command = [ "layout tiles" ];
gaps = {
outer.left = 8;
outer.bottom = 8;
Expand All @@ -31,6 +32,16 @@ in
${config.out}/user/Library/LaunchAgents/org.nixos.aerospace.plist`
echo >&2 "checking config in $conf"
if [ `cat $conf | wc -l` -eq "27" ]; then echo "aerospace.toml config correctly contains 27 lines"; else return 1; fi
grep 'after-startup-command = \["layout tiles"\]' $conf
grep 'bottom = 8' $conf
grep 'left = 8' $conf
grep 'right = 8' $conf
grep 'top = 8' $conf
grep 'alt-h = "focus left"' $conf
grep 'alt-j = "focus down"' $conf
grep 'alt-k = "focus up"' $conf
grep 'alt-l = "focus right"' $conf
'';
}

0 comments on commit 55d0781

Please sign in to comment.