-
Notifications
You must be signed in to change notification settings - Fork 770
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
i3bar: protocol for workspace buttons #3818
Comments
I like the idea and since we have the infrastructure to support IPC and JSON parsing this will not be very complex. @Airblader will have to approve though. Btw, are you willing to implement this? |
Btw, are you willing to implement this?
Yep.
|
Yes, I think this is a great, extensible solution. I'd say we for now start with a protocol that only covers what we currently need and leave additional features (such as separators) for follow-up work. So it would be good to define what that protocol could look like and then get the PR going. Something we need to decide is whether coloring focused / urgent workspaces is left up to that interface as well or whether this will still be done by i3bar. |
Another thing, I would not support multiple protocols here like we do in the status command and go for JSON right away. |
@xzfc Just wondering if you made any progress on this? |
@xzfc I am trying to get clarifications around the design so please bear with me if i am missing some parts. The way i see it this is pushing the complexity to people who are customising i3 in a very significant way. Here is my use case :
wsgroup is a grouping of wspaces with each having a unique id. Each func keys basically maps to one single ws group. The logic to managing all these is handled by the script internally. The script does not store state outside of i3 for all the existing wsgroup at all. Instead it stores this metadata as part of the i3 wspace name so effectively the wspace name is This proposal would make writing simple bindings/scripts like the one above i have more complicated because it has to be able to sync whit whatever Can someone tell me how i can make sure the binding i have above would work in the new scheme ? I might be missing something. |
I thought the i3ws.sh and |
@ymolists But the following much the same as what you describe. |
Hi, Is there any already existing mechanism that would allow me to hide specified workspaces on the bar? I am very much looking towards that feature. |
No, see the patches in #2333 for workarounds |
@xzfc Just wondering if you made any progress on this? I cant wait to start using an official supported way to hide workspaces. |
Would this only be available for i3bar, polybar's i3 module, and similar workspace indicators, or would it work with workspace indicators like the xworkspaces module for polybar? Not sure if I explained that well enough, but hopefully you can tell what I meant. |
This is purely i3bar, nothing else. Any other client is already free to display (or not display) whatever they choose. |
I actually forgot to specify what for! From what I understand, other clients like polybar are unable to display empty inactive workspaces because of i3 dynamically loading them, so I was wondering if the example of "show empty workspaces" would work with other clients. |
The concept of "empty workspaces" does not exist in i3 since there are
virtually infinite non-created workspaces. Third party bars can already
choose to display whatever non-existent workspace they wish. The difference
of the new protocol is that i3bar can do the same.
…On Tue, Jan 19, 2021, 21:25 Stardust-kyun ***@***.***> wrote:
This is purely i3bar, nothing else. Any other client is already free to
display (or not display) whatever they choose.
I actually forgot to specify what for! From what I understand, other
clients like polybar are unable to display empty inactive workspaces
because of i3 dynamically loading them, so I was wondering if the example
of "show empty workspaces" would work with other clients.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#3818 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMCZPVODOJMJDGGRLB6AYLS2XTBZANCNFSM4I7KS4JA>
.
|
Clients which strictly show workspaces based on EWMH will not show such workspaces since they don't exist and thus we don't list them in the hints. This feature won't change anything about that, no. |
Ah, I see. Do either of you know of any way that I can create dummy workspaces for xworkspaces or the like to somewhat create that? |
I don't even know that tool. Regardless, you can ask that question on the i3wm subreddit. Let's please keep the discussion here on topic. |
Alrighty, sorry for the confusion. Thanks! |
I am confused here... Do you mean to imply that there is already a way for clients to query the configured (but not existent) workspaces known to i3, or, else that such a feature is out of scope? I understand that erasing empty workspaces is long standing behaviour and I expect changing that would surely be a breaking change, but I get the (possibly mistaken) impression that you intend to make internal information available to i3-bar exclusively, which seems incongruous? Third-party tools may be free to display anything they like but, and I am happy to be disproven: it seems to me that (perhaps like i3-bar) almost all, if not all, clients that aren't entirely manual/static in the content they display, are designed to assume that the WM has exclusive authority over what information can be be displayed in the layout, including workspaces. I would argue, in fact, that this is necessary, in order to display dynamic content (which is to say, all content, with how i3 is designed). |
There are no "configured workspaces". Workspaces are created when you switch to them and exist for as long as there are windows on them or they are active on an output. Otherwise they don't exist, and thus also cannot be queried. That's true both externally and internally – i3bar doesn't know about them either, they simply do not exist. |
I was referring to the "show empty workspaces" feature which I see on the OP, has that been excluded from this issue, then? |
Currently, i3bar pulls its information on which workspaces exist from i3, which is fed by its internal state. With this PR you have a protocol such that you can define yourself where this information comes from. This allows you to enrich the information you query from i3's IPC with non-existing workspaces, or replace it entirely, which means those workspaces would be shown in i3bar. A feature like "show empty workspaces" cannot possibly be implemented, because empty workspaces don't exist in the first place. With this protocol you can choose how you want to implement it:
|
To clarify, I understand well enough that an empty workspace cannot exist in the sense that workspaces must be destroyed when they empty, as that is your convention. However, it appears as though this PR would introduce an analogous or an adjacent concept, specific to i3, and only in respect to the information emitted via IPC, is that correct? It seems like in your most recent comment, you are saying I would be able to feed artificial information into the IPC that other clients can then receive? I do not use i3bar currently; I don't know it would suit my needs (this issue aside); But I am not actually aware of any client/bar that would allow me to configure a manual set of workspaces without managing all IPC interactions myself. I recently switched to i3 to make use of it's mode switching, and found the lack of empty workspaces made it severely more time consuming to determine which, of the workspaces pinned to an output are free to use. On that note, these pinned workspaces, I would argue, ARE in fact configured and, as far as client are concerned, differ only in that said configuration cannot be observed when the workspace is out-in-use. The fact that this configuration is accessible only when in use is arguably part of the semantics of i3 and so, of course, any i3-aware client will naturally adopt the same model. The proposed IPC changes seem useful, but I don't actually see how they assist in the display of a pseudo-statically list of (potential) workspaces any more than not having these changes would? - It seems that it would not allow for any differentiation between a current and future workspace, without including third-party information tags, which standard clients would be unable to register. In that sense it may actually introduce more problems than it solves. Edit: it would probably be more useful to provide a feature that queries the output a non-existent workspace with a particular name has been configured to pin to, if any. |
No – this protocol does not feed the IPC. It feeds i3bar.
I don't know of one either, but this is really outside our control. We will not implement a feature to keep empty workspaces, this is the most we want to do to support it, but it requires i3bar. For other clients you'll have to raise feature requests to allow specifying workspaces to be shown despite not existing. |
I made an edit to my last post that is relevant on this point:
This pinning information is something that clients need to honour, to show the workspace on the correct bar instance; Without it, no client-side solution would be complete. |
I don't think I understand your edited-in sentence. Can you elaborate? |
Certainly. Consider, for example, the config line:
This is persistent configuration information within i3 but exposed, to my knowledge, only when the workspace is in use. It is, for the purposes of any IPC clients, |
I think what you're looking for is something you will get from #4427. |
Yes, that would certainly suffice, thank you! |
I cant wait for this feature. Can someone summarise the state it is in now ? Thank you for all your efforts ! |
There is PR #4311 that mostly works but I need to handle some issues regarding reading input line-by-line. ETA unknown. |
@orestisfl i am still hopeful someone will review/complete that PR !!! |
Proposal
I am proposing to add
ws_command
option to i3bar. It should be similar tostatus_command
but for controlling workspace buttons instead of statusline blocks.This would allow the user to define arbitrary complex customizations without introducing actual complexity into the i3bar code or i3bar configuration syntax.
Examples of customizations are:
Examples of per-button customizations:
"min_width":32
(related to Minimal width for workspace buttons #3711)"separator":true
— personally I find it is useful to visually separate groups of workspaces."color":[...]
— could be used to distinguish fake empty workspaces.Diagram
Example configurations
ws_command_default.sh
- recreate the default i3bar behavior.ws_command_hide.sh
- hide workspace namedfoo
unless it is visible.ws_command_show_empty.sh
- show empty workspacesfoo
andbar
onLVDS1
even if they do not exist at the moment.The text was updated successfully, but these errors were encountered: