stumpwm / mahogany

A stumpwm like Wayland compositor
GNU General Public License v2.0
220 stars 12 forks source link

Design (or find) a method for replicating Stumpwm's `colon` command #33

Open sdilts opened 8 months ago

sdilts commented 8 months ago

Background / Previous Work

To have the same features as Stumpwm, Mahogany needs to have client windows that issue commands to the compositor. Stumpwm does this by creating windows within the same process as itself, which leads to numerous problems that appear hard to overcome in a portable and easy to maintain manner.

Why Use a Wayland Protocol?

From what I can tell, the correct approach is one of two options:

From a Common Lisp perspective, using a dedicated Wayland protocol seems like the most portable and maintainable option. This is mostly because we would need to plug into the Wayland event loop using file descriptors or roll our own event loop in order to watch the stdout of the client app. From what I can see, neither of these things are particularly easy to do across Lisp implementations, but I'd be happy to be proven wrong. Moreover, using a Wayland protocol means that there would be a clear specification for how the communication between client and compositor would work, and it should be relatively easy to add features to the protocol if needed.

Protocol Requirements

Independent of what the actual implementation is, we would need to receive the following information from clients:

The wlr foreign toplevel management protocol could provide some additional insights to how to design such a protocol.

sdilts commented 8 months ago

As far as what the client would look like in this case, I see it as a one-off application that would take a single command, prompt the user for missing information if needed, submit the command, then exit. I could also see it displaying any errors that resulted when executing the command as well, but we probably should wait to do that to keep things simple.