Skip to content

Conversation

@patrick96
Copy link
Member

@patrick96 patrick96 commented Nov 28, 2018

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.

This is in preparation for fixing #1172, because I plan on making modules uniquely identifiable by their name.

@patrick96 patrick96 requested a review from NBonaparte November 28, 2018 14:57
@patrick96 patrick96 added this to the 3.4.0 milestone Dec 28, 2018
@patrick96 patrick96 modified the milestones: 3.4.0, 3.5.0 Jun 28, 2019
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.
@patrick96 patrick96 force-pushed the refactor/unqiue_module_names branch from fceae58 to d5ba601 Compare August 6, 2019 19:31
@patrick96 patrick96 requested a review from Lomadriel August 6, 2019 19:32
Copy link
Member

@Lomadriel Lomadriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • x11/types.hpp is unused in controller.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/b

but it doesn't work if module a is also using inheriting.

@patrick96
Copy link
Member Author

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 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.

@Lomadriel
Copy link
Member

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 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.

@patrick96 patrick96 force-pushed the refactor/unqiue_module_names branch from d5ba601 to 16af42a Compare August 6, 2019 21:04
@polybar polybar deleted a comment from codecov bot Aug 6, 2019
@polybar polybar deleted a comment from codecov bot Aug 6, 2019
@patrick96 patrick96 requested a review from Lomadriel August 6, 2019 21:07
Copy link
Member

@Lomadriel Lomadriel left a 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.
@patrick96 patrick96 force-pushed the refactor/unqiue_module_names branch from 16af42a to b6d670c Compare October 21, 2019 08:16
@polybar polybar deleted a comment from codecov bot Oct 21, 2019
@patrick96 patrick96 merged commit a119c33 into polybar:master Oct 21, 2019
@patrick96 patrick96 deleted the refactor/unqiue_module_names branch October 21, 2019 08:20
patrick96 added a commit to patrick96/polybar that referenced this pull request Oct 27, 2019
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
patrick96 added a commit that referenced this pull request Oct 27, 2019
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 #1534,
this will now print an error message.

This should help with this a bit.

Ref #1913
doronbehar added a commit to doronbehar/polybar that referenced this pull request Nov 13, 2019
…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
  ...
patrick96 added a commit to patrick96/polybar that referenced this pull request Jan 7, 2020
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.
patrick96 added a commit that referenced this pull request Jan 12, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants