feat(workspace-rule): add ability to only apply workspace rule on first

show of app
This commit is contained in:
Alvin Truong
2023-04-22 00:27:45 -07:00
committed by جاد
parent b647fdf01a
commit 4306a7bafe
6 changed files with 134 additions and 40 deletions

View File

@@ -525,6 +525,9 @@ struct WorkspaceRule {
monitor: usize,
/// Workspace index on the specified monitor (zero-indexed)
workspace: usize,
#[clap(short,long)]
/// Only apply once on first app load
apply_on_first_show_only: bool,
}
#[derive(Parser, AhkFunction)]
@@ -535,6 +538,9 @@ struct NamedWorkspaceRule {
id: String,
/// Name of a workspace
workspace: String,
#[clap(short,long)]
/// Only apply once on first app load
apply_on_first_show_only: bool,
}
#[derive(Parser, AhkFunction)]
@@ -1449,14 +1455,25 @@ fn main() -> Result<()> {
}
SubCommand::WorkspaceRule(arg) => {
send_message(
&SocketMessage::WorkspaceRule(arg.identifier, arg.id, arg.monitor, arg.workspace)
.as_bytes()?,
&SocketMessage::WorkspaceRule(
arg.identifier,
arg.id,
arg.monitor,
arg.workspace,
arg.apply_on_first_show_only,
)
.as_bytes()?,
)?;
}
SubCommand::NamedWorkspaceRule(arg) => {
send_message(
&SocketMessage::NamedWorkspaceRule(arg.identifier, arg.id, arg.workspace)
.as_bytes()?,
&SocketMessage::NamedWorkspaceRule(
arg.identifier,
arg.id,
arg.workspace,
arg.apply_on_first_show_only,
)
.as_bytes()?,
)?;
}
SubCommand::Stack(arg) => {