project-repo / cagebreak

Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison
MIT License
279 stars 20 forks source link

Multi-line message #48

Closed g4bwy closed 1 year ago

g4bwy commented 1 year ago

Hi,

After browsing through the current code in message.c and ipc_server.c, I figured the answer might be no, but is there a way to send a message command displaying multiple lines ?

From my understanding, commands sent to the IPC socket must be terminated with a \n, so it doesn't appear to be possible, but I might have missed something (double-escaping inside the message with '\n' is rendered verbatim so it doesn't work either).

I'm trying to implement an equivalent to ratpoison's (or stumpwm) 'windows' command using IPC, starting from the show_workspace_views.sh example script

thanks,

project-repo commented 1 year ago

Hi g4bwy As you correctly guessed, there is currently no way of achieving this. Our philosophy is that the complexity of the displayed messages should be kept to a minimum whenever possible and therefore, we do not plan to support multi-line messages.

Instead, the suggested workflow for emulating the windows command is as follows:

Does that work for you? If you see something we have overlooked in our considerations or if you have any further input don't hesitate to get back to us. Cheers project-repo

g4bwy commented 1 year ago

Hi,

Thanks for the quick reply, however, your suggestion wasn't exactly what I had in mind, since my intended use case is simply to have a one-shot view of open windows with their titles and id, like in the following screenshot: example

Anyway this is ok, since I found a way to make it work: since the message ends up being rendered using pango, adding \r for line breaks instead of \n seems to do the job ;)

Cheers,

project-repo commented 1 year ago

Great, glad to hear that you figured out a workaround, thanks for letting us know about it!

Cheers project-repo