-
-
Notifications
You must be signed in to change notification settings - Fork 717
feat: Module Visibility #2320
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
feat: Module Visibility #2320
Conversation
Approach looks good. Having the visibility information inside the module should make it easier in the future to actually pause/unpause modules when they are invisible. Btw. for all methods that you add to |
f96bcff
to
2444c08
Compare
Codecov Report
@@ Coverage Diff @@
## master #2320 +/- ##
=========================================
- Coverage 7.85% 7.83% -0.03%
=========================================
Files 142 142
Lines 10275 10303 +28
=========================================
Hits 807 807
- Misses 9468 9496 +28
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
db39f08
to
cdce000
Compare
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.
Good job!
Now that I see your implementation, I think it would be cleaner from a user perspective to be able to change module visibility through an action instead of a command, because then users could easily change module visibility through click actions instead of having to go through polybar-msg
(which also targets all bars).
But we are not going to do this here, because there is no way for all modules to share an action without adding it to every module separately. I have some ideas about action routing (see this comment) which could make this easier in the future.
But it's still a good idea to merge this.
Could you also add the name of the ipc commands to the changelog?
Would adding an additional config parameter to modules to determine default visibility be an idea? This would allow modules to be hidden by default. [module/mymodule]
visible=true ; defaults true
; OR
hidden=false ; defaults false This would be useful for, as an example, an email notification module which only appears when there are new/unread notifications.
This isn't the right place to have this discussion, but would overloads to the |
We already overload the |
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.
Code looks solid. I just recently moved the config.cmake
file into its own folder and that caused a merge conflict you need to resolve before we can merge this.
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
- Called in the module to maintain dependence on the signal emitter - Update CHANGELOG to make changes more verbose
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
09bffb8
to
0d6ef0e
Compare
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.
I went ahead and rebased against master so we can merge this.
I think having a module setting for the visible state is a good idea. Do you want to implement this in a new PR?
Yeah, I'll get working on that. |
Awesome! Thanks 😃 |
I have now more or less finished my action router idea (#2336) and adding universal actions like the visibility change actions seems quite easy. The only downside is that we can't use |
Or we could change the date action to |
The action names are the closest thing we have to a public API and I am not very keen on breaking it. I think people can live with |
People seem to like this feature ;) https://www.reddit.com/r/Polybar/comments/kssoga/the_new_showhide_module_feature_is_amazing/ |
IPC commands are no longer necessary now that the actions are implemented. Changed some method permissions as well to reflect this.
* Add toggle_visible action * Add set_visible and set_invisible actions * Rename toggle_visible method to match `action_toggle_visible` -> `action_toggle_visibility` Matches with `EVENT_TOGGLE_VISIBILITY` * Update CHANGELOG * Revert #2320 IPC commands IPC commands are no longer necessary now that the actions are implemented. Changed some method permissions as well to reflect this. * Add logging and change action names - `module_toggle` - `module_show` - `module_hide` Delineate common actions to all modules with a `module_` prefix (for future actions too) * Update documentation
What type of PR is this? (check all applicable)
Description
Creates new IPC commands to toggle the visibility of a specific module. End goal (as expressed in #2108) is to stop processing hidden modules, although I will probably complete an initial implementation to just hide the modules.
Related Issues & Documents
Closes #2108
Documentation (check all applicable)