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

zellij: add support for layouts #4612

Closed
wants to merge 7 commits into from
Closed

zellij: add support for layouts #4612

wants to merge 7 commits into from

Conversation

cgahr
Copy link

@cgahr cgahr commented Oct 28, 2023

Description

implements #4485

I added the programs.zellij.layouts which can contain name value pairs. The name is the name of the layout, while the value is the string being written to the respective layout file. The config would look as follows:

{
  # redefining the default layout
  default = ''
    layout {
      pane size=1 borderless=true {
        plugin location=\"zellij:tab-bar\"
      }
      pane
      pane size=2 borderless=true {
        plugin location=\"zellij:status-bar\"
      }
    }
  ''
}

This way of configuring layouts is somewhat suboptimal, since it doesn't use the toKDL parser. However, afaik, it is currently impossible to generate configs like:

layout {
  pane
  pane
  pane
}

which are perfectly valid kdl configs.

As such, this implementation is not forward compatible as an improved toKDL function would deprecate defining layouts as a string. I see two options forward:

  • either accept it as it is and, in the future, allow layouts to be either strings or proper nix sets
  • change the toKDL function (I'll probably create a PR to discuss such a change)

This is not covered by #4465.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@emilazy @foo-dogsquared @erikkrieg @h7x4

@cgahr cgahr changed the title add support for zellij layouts zellij: add support for layouts Oct 28, 2023
@cgahr cgahr mentioned this pull request Oct 29, 2023
6 tasks
Copy link

stale bot commented Jan 27, 2024

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.

If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

@stale stale bot added the status: stale label Jan 27, 2024
@cgahr cgahr closed this by deleting the head repository Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant