Skip to content

Add actions for the ipc module #2464

@patrick96

Description

@patrick96

With the new module action system, we can easily deprecate the old way of triggering hooks in the ipc module and replace it with a module action.

This has several advantages:

  • Cleaner way of handling messages (just register for certain action names)
  • Hooks can easily be triggered by click commands using the action syntax (``#module.name`)
  • Use the same system as all other modules

I propose adding the following actions:

  • hook: To trigger the given hook
  • next/prev: To trigger the next/previous hook. This would solve the request in add hook state token for ipc #999
  • append: To append text to the module (maybe a prepend as well)
  • reset: To reset the module contents (maybe also reset the currently active hook)

Additional Context

The hook action should use a 0-based index for selecting the hook. Currently polybar-msg hook uses a 1-based index. This should also be clearly communicated in the docs.

#2463 already implemented a first action in the ipc module to display arbitrary text.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions