feat(wm): add new cmd to set active border offset

This commit introduces a new command, active-window-border-offset, which
allows the user to offset the starting position of the active window
border, thereby allowing for thicker or thinner active window borders,
when used in conjunction with the active-window-border-width command.

resolve #232
This commit is contained in:
LGUG2Z
2022-12-19 19:00:37 -08:00
parent 00477e2696
commit 4ee4d199a0
6 changed files with 47 additions and 0 deletions

View File

@@ -450,6 +450,12 @@ struct ActiveWindowBorderWidth {
width: i32,
}
#[derive(Parser, AhkFunction)]
struct ActiveWindowBorderOffset {
/// Desired offset of the active window border
offset: i32,
}
#[derive(Parser, AhkFunction)]
struct Start {
/// Allow the use of komorebi's custom focus-follows-mouse implementation
@@ -755,6 +761,9 @@ enum SubCommand {
/// Set the width for the active window border
#[clap(arg_required_else_help = true)]
ActiveWindowBorderWidth(ActiveWindowBorderWidth),
/// Set the offset for the active window border
#[clap(arg_required_else_help = true)]
ActiveWindowBorderOffset(ActiveWindowBorderOffset),
/// Enable or disable focus follows mouse for the operating system
#[clap(arg_required_else_help = true)]
FocusFollowsMouse(FocusFollowsMouse),
@@ -1375,6 +1384,9 @@ fn main() -> Result<()> {
SubCommand::ActiveWindowBorderWidth(arg) => {
send_message(&SocketMessage::ActiveWindowBorderWidth(arg.width).as_bytes()?)?;
}
SubCommand::ActiveWindowBorderOffset(arg) => {
send_message(&SocketMessage::ActiveWindowBorderOffset(arg.offset).as_bytes()?)?;
}
SubCommand::ResizeDelta(arg) => {
send_message(&SocketMessage::ResizeDelta(arg.pixels).as_bytes()?)?;
}