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

Hide module if format "resolves" to being empty #699

Closed
tardypad opened this issue May 6, 2020 · 2 comments · Fixed by #1860
Closed

Hide module if format "resolves" to being empty #699

tardypad opened this issue May 6, 2020 · 2 comments · Fixed by #1860
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@tardypad
Copy link

tardypad commented May 6, 2020

Here is the config for my "capture" module

"pulseaudio#capture": {
  "format": "{format_source}",
  "format-source": "",
  "format-source-muted": ""
}

Its goal is to display the microphone icon only when it is not muted.
It works as intended. However when it is muted, the module is still present in the bar, showing nothing but still taking its space (as tested by setting a different background color for it)

My mpd module has the same issue

"mpd": {
  "format": "{stateIcon}",
  "format-stopped": "",
  "format-disconnected": "",
  "state-icons": {
    "paused": "",
    "playing": ""
  }
}

The module is still present when the server is stopped.

From what I see other modules I have seems correctly hidden when their format is empty.
My guess here is that the problem comes from the fact that the "format" key is not directly empty but "resolves" to it after some logic is applied. I believe the modules should be completely hidden in such cases as well.

@Alexays Alexays added the enhancement New feature or request label May 6, 2020
@Alexays
Copy link
Owner

Alexays commented May 29, 2020

Will be fixed with #676

@Alexays Alexays added this to the 1.0.0 milestone May 29, 2020
@WhyNotHugo
Copy link
Contributor

I've the exact same use case. Have you found any workaround in the meantime?
It seems that even if the source is muted, no additional css class is added to the module either, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants