using RemSox.Processes; using RemSox.Processing; namespace RemSox.UI.CLI.Commands; public class StopGuiCommand : ICommand { public string Name => "stop-gui"; public string Description => "Stops the Graphical User Interface (Desktop Process)"; public async Task ExecuteAsync(string? arguments, Action printLine) { printLine("Stopping Desktop Process..."); if (!ProcessManager.IsProcessRunning()) { printLine("Desktop Process is not running."); return; } foreach (Process process in ProcessManager.GetProcessesOfType()) { await ProcessManager.StopProcessAndWaitAsync(process.Id); } _ = ProcessManager.SpawnProcess(); } }