mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-16 18:11:14 +02:00
feat(cli): add toggle-window-based-work-area-offset cmd
This commit adds a command to toggle the application of a monitor's window-based work area offset for the focused workspace. resolve #1285
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
# toggle-window-based-work-area-offset
|
||||||
|
|
||||||
|
```
|
||||||
|
Toggle application of the window-based work area offset for the focused workspace
|
||||||
|
|
||||||
|
Usage: komorebic.exe toggle-window-based-work-area-offset
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help
|
||||||
|
Print help
|
||||||
|
|
||||||
|
```
|
||||||
@@ -185,6 +185,7 @@ pub enum SocketMessage {
|
|||||||
StackbarFontFamily(Option<String>),
|
StackbarFontFamily(Option<String>),
|
||||||
WorkAreaOffset(Rect),
|
WorkAreaOffset(Rect),
|
||||||
MonitorWorkAreaOffset(usize, Rect),
|
MonitorWorkAreaOffset(usize, Rect),
|
||||||
|
ToggleWindowBasedWorkAreaOffset,
|
||||||
ResizeDelta(i32),
|
ResizeDelta(i32),
|
||||||
InitialWorkspaceRule(ApplicationIdentifier, String, usize, usize),
|
InitialWorkspaceRule(ApplicationIdentifier, String, usize, usize),
|
||||||
InitialNamedWorkspaceRule(ApplicationIdentifier, String, String),
|
InitialNamedWorkspaceRule(ApplicationIdentifier, String, String),
|
||||||
|
|||||||
@@ -1458,6 +1458,14 @@ impl WindowManager {
|
|||||||
self.retile_all(false)?;
|
self.retile_all(false)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SocketMessage::ToggleWindowBasedWorkAreaOffset => {
|
||||||
|
let workspace = self.focused_workspace_mut()?;
|
||||||
|
workspace.set_apply_window_based_work_area_offset(
|
||||||
|
!workspace.apply_window_based_work_area_offset(),
|
||||||
|
);
|
||||||
|
|
||||||
|
self.retile_all(false)?;
|
||||||
|
}
|
||||||
SocketMessage::QuickSave => {
|
SocketMessage::QuickSave => {
|
||||||
let workspace = self.focused_workspace()?;
|
let workspace = self.focused_workspace()?;
|
||||||
let resize = workspace.resize_dimensions();
|
let resize = workspace.resize_dimensions();
|
||||||
|
|||||||
@@ -1155,6 +1155,8 @@ enum SubCommand {
|
|||||||
/// Set offsets for a monitor to exclude parts of the work area from tiling
|
/// Set offsets for a monitor to exclude parts of the work area from tiling
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
MonitorWorkAreaOffset(MonitorWorkAreaOffset),
|
MonitorWorkAreaOffset(MonitorWorkAreaOffset),
|
||||||
|
/// Toggle application of the window-based work area offset for the focused workspace
|
||||||
|
ToggleWindowBasedWorkAreaOffset,
|
||||||
/// Set container padding on the focused workspace
|
/// Set container padding on the focused workspace
|
||||||
#[clap(arg_required_else_help = true)]
|
#[clap(arg_required_else_help = true)]
|
||||||
FocusedWorkspaceContainerPadding(FocusedWorkspaceContainerPadding),
|
FocusedWorkspaceContainerPadding(FocusedWorkspaceContainerPadding),
|
||||||
@@ -1878,6 +1880,9 @@ fn main() -> Result<()> {
|
|||||||
bottom: arg.bottom,
|
bottom: arg.bottom,
|
||||||
}))?;
|
}))?;
|
||||||
}
|
}
|
||||||
|
SubCommand::ToggleWindowBasedWorkAreaOffset => {
|
||||||
|
send_message(&SocketMessage::ToggleWindowBasedWorkAreaOffset)?;
|
||||||
|
}
|
||||||
SubCommand::ContainerPadding(arg) => {
|
SubCommand::ContainerPadding(arg) => {
|
||||||
send_message(&SocketMessage::ContainerPadding(
|
send_message(&SocketMessage::ContainerPadding(
|
||||||
arg.monitor,
|
arg.monitor,
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ nav:
|
|||||||
- cli/invisible-borders.md
|
- cli/invisible-borders.md
|
||||||
- cli/global-work-area-offset.md
|
- cli/global-work-area-offset.md
|
||||||
- cli/monitor-work-area-offset.md
|
- cli/monitor-work-area-offset.md
|
||||||
|
- cli/toggle-window-based-work-area-offset.md
|
||||||
- cli/focused-workspace-container-padding.md
|
- cli/focused-workspace-container-padding.md
|
||||||
- cli/focused-workspace-padding.md
|
- cli/focused-workspace-padding.md
|
||||||
- cli/adjust-container-padding.md
|
- cli/adjust-container-padding.md
|
||||||
|
|||||||
Reference in New Issue
Block a user