-
-
Notifications
You must be signed in to change notification settings - Fork 717
Added format-x support for ipc_module, tested with demo config #2810
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2810 +/- ##
==========================================
- Coverage 13.49% 13.47% -0.02%
==========================================
Files 152 151 -1
Lines 11422 11515 +93
==========================================
+ Hits 1541 1552 +11
- Misses 9881 9963 +82
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
I have unfortunately noticed that this breaks any existing config that does formatting:
[module/ipc]
type = custom/ipc
hook-0 = echo foobar
format-background = #f00
format-foreground = #fff
The current behavior for this is that the module will display foobar
with white text and red background.
However, with this PR, those settings are ignored (since we are now using format-0
) and the module displays foobar
with the bar background and foreground colors.
This makes things more difficult than I first thought. At the very least, we should fall back to format
if format-N
is not defined.
Please also add a changelog entry for your changes: https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md#changelog
And run clang-format
on the files you modified: https://polybar.readthedocs.io/en/latest/dev/style-guide.html#code-formatting
Working on it asap. |
There is really no need for stressing about completing this. Take your time, we're not in a hurry :) |
Sorry I have been busy last month, Im still stuck on this spot. A few observations I made, for this config
Works with colors of the main bar, hence what I observed is that we should only call add() if there exists format-x in the config. |
I think configuration 2 above is the way to go here. There is no good way to make it work without defininig As to why the module doesn't show anything for that, I don't know. If you upload the latest changes, I may be able to take a look.
The thing you're looking for is |
Latest changes demonstrate that if format-X is defined, the module just doesnt output anything (as if it crashed). Comment format-0, so it will reach hook-0 output, from there if you trigger any other hook it hides itself. |
if (m_conf.has(m_name, format_i)) {
return DEFAULT_FORMAT;
} else {
return format_i;
} I notice that, if format is defined, or format-x is defined, and get_format returns the defined format in interest, then the module fails. |
Ah, I see what the issue is. |
in this particular config,I want say the partial config of format defined here and partial config of a format-x, to be used in the output. However format-1-background is not defined, its falling back to bars default color. Is it possible to mix things up ? I tried looking around the render function calls , didnt notice at first glance. |
Also, since output is deprecated in some other modules, I can also work on label support for IPC module. |
No. When any property on a format is not defined, it falls back to how that property is defined in the
That would be cool. I think the ipc module is the only one that doesn't have any labels. But wait until we merged this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this seems to be working now 😃
Plase also add a changelog entry and then we can merge this. https://github.com/polybar/polybar/blob/master/CONTRIBUTING.md#changelog
What type of PR is this? (check all applicable)
Description
Users can now assign separate formats for different hooks inside the IPC module.
Related Issues & Documents
Closes #2775
Documentation (check all applicable)
Changes to documentation
In wiki > Modules > ipc
Examples,