Skip to content

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

feat: aliases for app commands

Lars Bergere2b8e185107a
diff --git a/packages/wm/src/app_command.rs b/packages/wm/src/app_command.rs
index 94a3a9db..5e2fd945 100644
--- a/packages/wm/src/app_command.rs
+++ b/packages/wm/src/app_command.rs
@@ -46,6 +46,7 @@ pub enum AppCommand {
/// Retrieves and outputs a specific part of the window manager's state.
///
/// Requires an already running instance of the window manager.
+ #[clap(alias = "q")]
Query {
#[clap(subcommand)]
command: QueryCommand,
@@ -54,7 +55,8 @@ pub enum AppCommand {
/// Invokes a window manager command.
///
/// Requires an already running instance of the window manager.
- Cmd {
+ #[clap(alias = "c")]
+ Command {
#[clap(short = 'c')]
subject_container_id: Option<Uuid>,
@@ -66,6 +68,7 @@ pub enum AppCommand {
/// continuously outputs the incoming events.
///
/// Requires an already running instance of the window manager.
+ #[clap(alias = "su")]
Subscribe {
/// WM event(s) to subscribe to.
#[clap(short = 'e', long, value_enum, num_args = 1..)]
@@ -75,6 +78,7 @@ pub enum AppCommand {
/// Unsubscribes from a prior event subscription.
///
/// Requires an already running instance of the window manager.
+ #[clap(alias = "us")]
Unsubscribe {
/// Subscription ID to unsubscribe from.
#[clap(long = "id")]
diff --git a/packages/wm/src/ipc_server.rs b/packages/wm/src/ipc_server.rs
index 58a8e14e..9e4a8c94 100644
--- a/packages/wm/src/ipc_server.rs
+++ b/packages/wm/src/ipc_server.rs
@@ -202,7 +202,7 @@ impl IpcServer {
Ok(ClientResponseData::Focused(wm.state.focused_container()))
}
},
- Ok(AppCommand::Cmd {
+ Ok(AppCommand::Command {
subject_container_id,
command,
}) => wm