mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-29 21:52:05 +02:00
feat(config): add work-area-offset per workspace
This commit adds the option to set 'work_area_offset' per workspace. If no workspace work area offset is set for that workspace it will instead use the value of the globals.work_area_offset for that workspace. This commit adds a command to set the work area offset of a workspace given a monitor index and a workspace index.
This commit is contained in:
@@ -428,6 +428,22 @@ struct MonitorWorkAreaOffset {
|
||||
bottom: i32,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct WorkspaceWorkAreaOffset {
|
||||
/// Monitor index (zero-indexed)
|
||||
monitor: usize,
|
||||
/// Workspace index (zero-indexed)
|
||||
workspace: usize,
|
||||
/// Size of the left work area offset (set right to left * 2 to maintain right padding)
|
||||
left: i32,
|
||||
/// Size of the top work area offset (set bottom to the same value to maintain bottom padding)
|
||||
top: i32,
|
||||
/// Size of the right work area offset
|
||||
right: i32,
|
||||
/// Size of the bottom work area offset
|
||||
bottom: i32,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct MonitorIndexPreference {
|
||||
/// Preferred monitor index (zero-indexed)
|
||||
@@ -1188,6 +1204,9 @@ enum SubCommand {
|
||||
/// Set offsets for a monitor to exclude parts of the work area from tiling
|
||||
#[clap(arg_required_else_help = true)]
|
||||
MonitorWorkAreaOffset(MonitorWorkAreaOffset),
|
||||
/// Set offsets for a workspace to exclude parts of the work area from tiling
|
||||
#[clap(arg_required_else_help = true)]
|
||||
WorkspaceWorkAreaOffset(WorkspaceWorkAreaOffset),
|
||||
/// Toggle application of the window-based work area offset for the focused workspace
|
||||
ToggleWindowBasedWorkAreaOffset,
|
||||
/// Set container padding on the focused workspace
|
||||
@@ -1938,6 +1957,20 @@ fn main() -> Result<()> {
|
||||
bottom: arg.bottom,
|
||||
}))?;
|
||||
}
|
||||
|
||||
SubCommand::WorkspaceWorkAreaOffset(arg) => {
|
||||
send_message(&SocketMessage::WorkspaceWorkAreaOffset(
|
||||
arg.monitor,
|
||||
arg.workspace,
|
||||
Rect {
|
||||
left: arg.left,
|
||||
top: arg.top,
|
||||
right: arg.right,
|
||||
bottom: arg.bottom,
|
||||
},
|
||||
))?;
|
||||
}
|
||||
|
||||
SubCommand::ToggleWindowBasedWorkAreaOffset => {
|
||||
send_message(&SocketMessage::ToggleWindowBasedWorkAreaOffset)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user