Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load custom layouts from file #50

Closed
LGUG2Z opened this issue Oct 18, 2021 · 2 comments
Closed

Load custom layouts from file #50

LGUG2Z opened this issue Oct 18, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@LGUG2Z
Copy link
Owner

LGUG2Z commented Oct 18, 2021

The default layouts do not always provide for a nice experience on ultrawide monitors and allowing custom layouts to be defined and loaded on the fly would be a big improvement in this area.

@LGUG2Z LGUG2Z added the enhancement New feature or request label Oct 18, 2021
@LGUG2Z LGUG2Z self-assigned this Oct 18, 2021
@LGUG2Z
Copy link
Owner Author

LGUG2Z commented Oct 18, 2021

Work on this issue has been started here: https://github.com/LGUG2Z/komorebi/tree/feature/custom-layouts

  • The column is the basic building block of custom layouts
  • Vertical splits in custom layouts can be arranged but not navigated, so vertical splits are disabled for now (fixing this should probably be in scope for this issue)
  • Resizing support is not in scope for this issue (may be worked on in a separate issue when/if there is a user request)
  • Layout flipping support is not in scope for this issue (may be worked on in a separate issue when/if there is a user request)

Anyone can now build from this branch and load custom layouts with the komorebic load-layout layout-file.json command. The complete schema for custom layout definition is here and the validation rules are here.

Example of a valid custom layout JSON file:

[
  {
    "column": "Secondary",
    "configuration": {
      "Horizontal": 3
    }
  },
  {
    "column": "Primary"
  },
  {
    "column": "Tertiary",
    "configuration": "Horizontal"
  }
]

LGUG2Z added a commit that referenced this issue Oct 18, 2021
This commit adds a ColumnWidth for Column::Primary which can optionally
be given as a percentage of the total work area of a monitor. The
remaining columns will have their widths calculated by dividing the
remaining work area space evenly.

This commit also fixes a bug with the Promote command, which was not
calculating the primary container index of custom layouts properly, and
was also not using this value to update the focused container index at
the end of the promotion handler.

re #50
LGUG2Z added a commit that referenced this issue Oct 18, 2021
This commit adds support for loading custom layouts from yaml files, and
also moves the custom layout loading and validating logic into the
komorebi-core crate.

re #50
@LGUG2Z
Copy link
Owner Author

LGUG2Z commented Oct 18, 2021

Support for YAML files has also been added, example:

- column: Secondary
  configuration:
    Horizontal: 2
- column: Primary
  configuration:
    WidthPercentage: 50
- column: Tertiary
  configuration: Horizontal

LGUG2Z added a commit that referenced this issue Oct 21, 2021
This commit adds some documentation around custom layouts as well as a
YAML example. The load-layout command has been renamed to
load-custom-layout for consistency.

re #50
LGUG2Z added a commit that referenced this issue Oct 21, 2021
This commit adds a ColumnWidth for Column::Primary which can optionally
be given as a percentage of the total work area of a monitor. The
remaining columns will have their widths calculated by dividing the
remaining work area space evenly.

This commit also fixes a bug with the Promote command, which was not
calculating the primary container index of custom layouts properly, and
was also not using this value to update the focused container index at
the end of the promotion handler.

re #50
LGUG2Z added a commit that referenced this issue Oct 21, 2021
This commit adds support for loading custom layouts from yaml files, and
also moves the custom layout loading and validating logic into the
komorebi-core crate.

re #50
@LGUG2Z LGUG2Z closed this as completed in 59a4a62 Oct 21, 2021
LGUG2Z added a commit that referenced this issue Oct 21, 2021
This commit adds some documentation around custom layouts as well as a
YAML example.

The load-layout command has been renamed to load-custom-layout for
consistency.

resolve #50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant