mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
aerospace: skip config reload when AeroSpace is not running
Avoid failing Home Manager activation when the generated AeroSpace configuration changes while AeroSpace is not yet running. The onChange hook can run before a running AeroSpace instance is available. Probe the running instance with `aerospace list-modes --current` before calling `reload-config`, and skip the reload if AeroSpace is not yet running.
This commit is contained in:
@@ -208,7 +208,11 @@ in
|
||||
|
||||
onChange = lib.mkIf cfg.launchd.enable ''
|
||||
echo "AeroSpace config changed, reloading..."
|
||||
${lib.getExe cfg.package} reload-config
|
||||
if ${lib.getExe cfg.package} list-modes --current >/dev/null 2>&1; then
|
||||
${lib.getExe cfg.package} reload-config
|
||||
else
|
||||
echo "AeroSpace is not running yet, skipping reload-config."
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user