Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat(domain): handle parsing of 'toggle floating' command string

Lars Berger0fa870b4017d
diff --git a/GlazeWM.Domain/UserConfigs/CommandParsingService.cs b/GlazeWM.Domain/UserConfigs/CommandParsingService.cs
index 8e6e64c0..837dc642 100644
--- a/GlazeWM.Domain/UserConfigs/CommandParsingService.cs
+++ b/GlazeWM.Domain/UserConfigs/CommandParsingService.cs
@@ -34,6 +34,7 @@ namespace GlazeWM.Domain.UserConfigs
"focus" => ParseFocusCommand(commandParts),
"move" => ParseMoveCommand(commandParts),
"resize" => ParseResizeCommand(commandParts),
+ "toggle" => ParseToggleCommand(commandParts),
"close" => new CloseFocusedWindowCommand(),
_ => throw new ArgumentException(),
};
@@ -95,6 +96,15 @@ namespace GlazeWM.Domain.UserConfigs
};
}
+ private Command ParseToggleCommand(string[] commandParts)
+ {
+ return commandParts[1] switch
+ {
+ "floating" => new ToggleFocusedWindowFloatingCommand(),
+ _ => throw new ArgumentException(),
+ };
+ }
+
/// <summary>
/// Checks whether a workspace exists with the given name.
/// </summary>