-
-
Notifications
You must be signed in to change notification settings - Fork 723
controller: Print error for duplicate modules #1534
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
controller: Print error for duplicate modules #1534
Conversation
Before if you wanted to iterate over all loaded modules you had to first iterate over all blocks and then over their modules even if you didn't care about alignment.
fceae58 to
d5ba601
Compare
Lomadriel
left a comment
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.
x11/types.hppis unused incontroller.cpp
Should we fix #412 before merging this?
Since we deprecate using two time the same module, I think we need to promote an alternative which is not copy/paste.
I was thinking about just doing that:
[module/a]
…
[module/b]
inherit = module/bbut it doesn't work if module a is also using inheriting.
I don't think so. We only prohibit having the exact same module in the bar multiple times. I don't think anyone even has that in their config since they will display the exact same thing. You can still have the same module type multiple times. |
Indeed that's true. |
d5ba601 to
16af42a
Compare
Lomadriel
left a comment
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.
LGTM.
You can't use the same name twice inside the module lists E.g. modules-left = a b c modules-center = a modules-right = b would print an error. We only print an error for now because we don't want to break existing configs. But in the future this should be properly enforced.
16af42a to
b6d670c
Compare
Some people use text modules instead of the `separator` key in the bar section to better configure the separator (colors, fonts). Since we disallowed the same module being used multiple times in polybar#1534, this will now print an error message. This should help with this a bit. Ref polybar#1913
…eaudio-port * 'master' of https://github.com/polybar/polybar: (37 commits) github: Add subreddit as contact link aur: Update maintainer Update PKGBUILD for 3.4.1 ipc: Remove unused global setting build: Move all possible variables into settings.cpp fix(http): Pass char* as CURLOPT_USERAGENT build: Move non-macro variables into settings.cpp Update spec file clang-format bar: Make module separator a label build: drop python2 fix(build): Ignore noexcept-type for malloc_ptr_t travis: update to bionic fix(backlight): Use 'brightness' with amdgpu_bl0 fix(bar): Configure window before remapping controller: Print error for duplicate modules (polybar#1534) feat(xworkspaces): Support occupied workspaces (polybar#882) temperature: Use format-warn at warn-temperature not after (polybar#1897) feat(pulse): Show volume in decibels (polybar#1894) fix(ipc): Update bar when making bar visible ...
Functionality-wise reverts the changes from polybar#1534 In polybar#1907 we have decided to allow the same module to appear multiple times (and deliver actions to all matching modules). But since that PR will likely take longer to get merged, I want to remove the error from polybar because the message it prints isn't really true anymore.
Functionality-wise reverts the changes from #1534 In #1907 we have decided to allow the same module to appear multiple times (and deliver actions to all matching modules). But since that PR will likely take longer to get merged, I want to remove the error from polybar because the message it prints isn't really true anymore.
You can't use the same name twice inside the module lists
E.g.
would print an error.
We only print an error for now because we don't want to break existing
configs. But in the future this should be properly enforced.
This is in preparation for fixing #1172, because I plan on making modules uniquely identifiable by their name.