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

Configurable shrinking #5887

Open
Arc676 opened this issue Jan 28, 2024 · 7 comments
Open

Configurable shrinking #5887

Arc676 opened this issue Jan 28, 2024 · 7 comments

Comments

@Arc676
Copy link
Contributor

Arc676 commented Jan 28, 2024

I'm submitting a…

[ ] Bug
[x] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

The purpose of this issue is to track support for customizable block shrinking as described in #4113 (specifically this comment).

Current Behavior

The original behavior of i3bar is to use short mode either for all the blocks or none of the blocks. With #5818 merged, the blocks are now shortened progressively (based on the original feature description in #4113) such that the maximum number of blocks retain their full length while still ensuring that the bar length does not exceed its limit. However, the blocks are shortened in order and there is no option to force a certain block to retain its full length with greater priority than other blocks.

Desired Behavior

The user should be able to specify priority values for the blocks such that the blocks with the least important information (or whatever other heuristic the user desires) are shortened first, while the more "interesting" blocks retain their full length and only switch to short form if the bar is too long even after the "less interesting" blocks are shortened.

Impact

[ ] This feature requires new configuration
[x] This feature expands the i3 protocol

In the absence of any explicit configuration, i3bar would treat all blocks as having the same priority and thus shrink the blocks in order, as is the behavior already implemented in #5818. Therefore the feature does not require additional configuration in existing environments, per se, since users would be free to ignore this feature.

A prototype implementation of configurable shrinking is visible in the history of #5818 (removed before merging).

This feature expands the protocol by adding another optional data field to the JSON blocks. However, I believe the added complexity is not very significant and the additional flexibility provided to users would be an overall improvement.

@i3bot
Copy link

i3bot commented Jan 28, 2024

Please note that new features which require additional configuration will usually not be considered. We are happy with the feature set of i3 and want to focus in fixing bugs instead. We do accept feature requests, however, and will evaluate whether the added benefit (clearly) outweighs the complexity it adds to i3.

Keep in mind that i3 provides a powerful way to interact with it through its IPC interface: https://i3wm.org/docs/ipc.html.

@MaxVerevkin
Copy link

MaxVerevkin commented Jan 29, 2024

such that the maximum number of blocks retain their full length

treat all blocks as having the same priority and thus shrink the blocks in order

Shrinking blocks in order does not produce the maximum number of full-sized blocks. Maybe assign short_width - full_width to be the priority if none of the blocks have this property set?

@Arc676
Copy link
Contributor Author

Arc676 commented Jan 29, 2024

Good point, shrinking in order indeed doesn't give the absolute maximum number of full sized blocks, just the maximum number of consecutive blocks starting from the end of the list.

Using the width change as the default priority is a good idea too; that behavior would actually match my own use case quite well. I suppose this would also properly guarantee the absolute maximum number of full sized blocks.

I know that there is a tendency to avoid adding additional configuration to i3 at this point, but for completeness: this could also be configurable behavior. It was suggested in the original thread that some users might prefer the original "all or nothing" approach to shrinking, e.g. for vertical displays. The default methodology for inferred shrinking priority could also be configurable. But this would certainly introduce more complexity, which is maybe undesired for i3 at this stage.

@Arc676
Copy link
Contributor Author

Arc676 commented Feb 23, 2024

If additional configuration is undesired, the aforementioned length-based prioritization could also be made to be the only behavior, instead of the current "shrink in order" implementation. No user configuration would be required at all; this would simply be how i3bar behaves.

@orestisfl
Copy link
Member

I think length-based prioritization can be chaotic as different blocks can change their length dynamically

@MaxVerevkin
Copy link

I think length-based prioritization can be chaotic as different blocks can change their length dynamically

As a user of a bar with "delta-length" prioritization implemented, I can say that it is not chaotic.

@orestisfl
Copy link
Member

orestisfl commented Feb 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants