project-repo / cagebreak

Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison
MIT License
284 stars 19 forks source link

Feature request: custom events via IPC #45

Closed sodface closed 1 year ago

sodface commented 1 year ago

If process A is already listening for cagebreak events via IPC, it would be helpful if process B could relay a custom event through the socket to process A.

Herbstluftwm has this functionality via emit_hook.

This can sort of be accomplished by abusing the definemode command with the mode being the message to pass (without spaces) to the process listening to IPC events. The modes are saved by cagebreak though, so these will quickly stack up and there doesn't seem to be a complement deletemode command. But this isn't the purpose of definemode anyway.

project-repo commented 1 year ago

Hi sodface

this feature seems to be a good idea. We will implement it in due course.

The implementation will probably take the shape of a command

command "string"

where the string is the message which will be sent over the socket (using the json structure as usual).

cheers project-repo

project-repo commented 1 year ago

Hi sodface, we pushed a new branch feature/custom_socket_event yesterday, which implements this. If you like, you can give it a spin: the feature branch introduces a new command custom_event with the same syntax as message. Documentation has not yet been written. Cheers, project-repo

sodface commented 1 year ago

Working for me, nice! Thanks again.

project-repo commented 1 year ago

Fixed in 2.2.0