mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-24 17:48:34 +02:00
feat(cli): add session float rule cmds
This commit introduces three new commands, session-float-rule, session-float-rules, and clear-session-float-rules, which add a composite float rule for the currently focused window for the duration of the komorebi session, print the float rules scoped to the current komorebi session, and clear any float rules scoped to the current komorebi session respectively. The composite rule created is fairly strict, using MatchingStrategy::Equals on the Exe, Class and Title. Users can run session-float-rule as they are working to avoid having to break their workflow and edit their configuration file, and when they are ready, they can run session-float-rules to print out the composite rules which have been generated and added to the current session to further refine before adding them to their configuration files. re #1402
This commit is contained in:
@@ -1323,6 +1323,12 @@ enum SubCommand {
|
||||
/// Set the operation behaviour when the focused window is not managed
|
||||
#[clap(arg_required_else_help = true)]
|
||||
UnmanagedWindowOperationBehaviour(UnmanagedWindowOperationBehaviour),
|
||||
/// Add a rule to float the foreground window for the rest of this session
|
||||
SessionFloatRule,
|
||||
/// Show all session float rules
|
||||
SessionFloatRules,
|
||||
/// Clear all session float rules
|
||||
ClearSessionFloatRules,
|
||||
/// Add a rule to ignore the specified application
|
||||
#[clap(arg_required_else_help = true)]
|
||||
#[clap(alias = "float-rule")]
|
||||
@@ -2535,6 +2541,15 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
|
||||
}
|
||||
}
|
||||
}
|
||||
SubCommand::SessionFloatRule => {
|
||||
send_message(&SocketMessage::SessionFloatRule)?;
|
||||
}
|
||||
SubCommand::SessionFloatRules => {
|
||||
print_query(&SocketMessage::SessionFloatRules);
|
||||
}
|
||||
SubCommand::ClearSessionFloatRules => {
|
||||
send_message(&SocketMessage::ClearSessionFloatRules)?;
|
||||
}
|
||||
SubCommand::IgnoreRule(arg) => {
|
||||
send_message(&SocketMessage::IgnoreRule(arg.identifier, arg.id))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user