Skip to content

[Feature] Set window width/height to monitor width/height #19

@zea64

Description

@zea64

A common use case is creating a bar with width equal to monitor width, but currently there is no way to either tell spell to set the width to monitor width in e.g. WindowConf nor does spell expose any way to manually query monitor dimensions.

Ideas:

  1. WindowConfBuilder.width(0) signals to spell to query monitor widths and pick the max, but this would make your window too large on a smaller monitor in a multimonitor setup unless you changed the width later manually.
  2. WindowConfBuilder.width(0) means pick the width of the monitor the window will be spawned on. idk if this is even possible with the protocol, might require an initial spawn followed by setting the width.
  3. WindowConfBuilder.width(0).monitor(name) does the right thing on that monitor without the issues of idea 2.
  4. API to query monitors so you can set correct dimensions yourself. In a multimonitor setup you would then set WindowConfBuilder.monitor(name) to make sure it spawns on the monitor with the dimensions you specified.

I can imagine some use cases that would want the monitor dimensions without using them to make something take up the monitor's width/height (e.g. half-width bar), so I think the monitor query API would be nice regardless. Also, in regards to the WindowConfBuilder.width(0) idea, perhaps in a future breaking release that parameter could be changed to a non_exhaustive enum to allow adding variants like Fill or Percent(50).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions