mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-19 07:19:50 +02:00
feat(wm): add direction preselection
This commit adds a new feature to preselect the direction of the next spawned window with a corresponding komorebic preselect-direction command which takes an OperationDirection. If the OperationDirection is valid from the current position, it will be stored in the Workspace state, and then read, applied, and deleted when the next manage-able window is spawned. Direction preselection does not (yet?) support the Grid layout.
This commit is contained in:
@@ -151,6 +151,7 @@ macro_rules! gen_enum_subcommand_args {
|
||||
gen_enum_subcommand_args! {
|
||||
Focus: OperationDirection,
|
||||
Move: OperationDirection,
|
||||
PreselectDirection: OperationDirection,
|
||||
CycleFocus: CycleDirection,
|
||||
CycleMove: CycleDirection,
|
||||
CycleMoveToWorkspace: CycleDirection,
|
||||
@@ -1095,6 +1096,9 @@ enum SubCommand {
|
||||
/// Move the focused window in the specified direction
|
||||
#[clap(arg_required_else_help = true)]
|
||||
Move(Move),
|
||||
/// Preselect the specified direction for the next window to be spawned on supported layouts
|
||||
#[clap(arg_required_else_help = true)]
|
||||
PreselectDirection(PreselectDirection),
|
||||
/// Minimize the focused window
|
||||
Minimize,
|
||||
/// Close the focused window
|
||||
@@ -2038,6 +2042,9 @@ fn main() -> eyre::Result<()> {
|
||||
SubCommand::Move(arg) => {
|
||||
send_message(&SocketMessage::MoveWindow(arg.operation_direction))?;
|
||||
}
|
||||
SubCommand::PreselectDirection(arg) => {
|
||||
send_message(&SocketMessage::PreselectDirection(arg.operation_direction))?;
|
||||
}
|
||||
SubCommand::CycleFocus(arg) => {
|
||||
send_message(&SocketMessage::CycleFocusWindow(arg.cycle_direction))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user