[GH-ISSUE #334] Use module value as argument in show_if #125

Closed
opened 2026-05-22 21:51:19 +01:00 by JakeStanger · 1 comment
Owner

Originally created by @kepi on GitHub (Oct 16, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/334

Is your feature request related to a problem? Please describe.

I would like to i.e. hide some module when it's text is some specific value.

For simplification, this might be another solution to problem and example mentioned in #333 but this would be usefull for more modules than script.

Describe the solution you'd like

Maybe get value of module as argument to show_if script so I can do something like

show_if: $1 != "󰏕 0"

Describe alternatives you've considered

I don't think that there is any alternative possible. For script module, it might be with ironvars, but for other modules, there probably isn't (or I didn't find it in docs).

Originally created by @kepi on GitHub (Oct 16, 2023). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/334 **Is your feature request related to a problem? Please describe.** I would like to i.e. hide some module when it's text is some specific value. For simplification, this might be another solution to problem and example mentioned in #333 but this would be usefull for more modules than `script`. **Describe the solution you'd like** Maybe get value of module as argument to `show_if` script so I can do something like ``` show_if: $1 != "󰏕 0" ``` **Describe alternatives you've considered** I don't think that there is any alternative possible. For `script` module, it might be with ironvars, but for other modules, there probably isn't (or I didn't find it in docs).
Author
Owner

@JakeStanger commented on GitHub (Oct 16, 2023):

I'm going to reject this one I'm afraid, as I don't think it'd be feasible. As explained in my comment in #333, show_if does not have this sort of context about the module, and adding it would be non-trivial. There are also some scenarios where it doesn't make sense (what is the "value" of the workspaces module, or the launcher?).

Instead, ironvars are the only way of going about this. You can use show_if with an ironvar on any module type, and any of script, label or custom will suit your use-case here depending on how much flexibility you need.

In the future if there is a clear use-case I may expand the ironvar system to provide some "system" variables, which could expose values from modules. This would likely be a limited and hard-coded set of values though.

<!-- gh-comment-id:1765308485 --> @JakeStanger commented on GitHub (Oct 16, 2023): I'm going to reject this one I'm afraid, as I don't think it'd be feasible. As explained in [my comment](https://github.com/JakeStanger/ironbar/issues/333#issuecomment-1765288026) in #333, `show_if` does not have this sort of context about the module, and adding it would be non-trivial. There are also some scenarios where it doesn't make sense (what is the "value" of the `workspaces` module, or the `launcher`?). Instead, ironvars are the only way of going about this. You can use `show_if` with an ironvar on any module type, and any of `script`, `label` or `custom` will suit your use-case here depending on how much flexibility you need. In the future if there is a clear use-case I may expand the ironvar system to provide some "system" variables, which could expose values from modules. This would likely be a limited and hard-coded set of values though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#125
No description provided.