alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
252 stars 13 forks source link

Documentation about new client #49

Closed limbo127 closed 2 years ago

limbo127 commented 2 years ago

Hello, do you have some document to how implement "The client could use the same IPC socket and YAML streaming protocol as the CLI." our application ( a simple desktop ) runs on sway and we want dev a go app to control monitor . Regards, Nicolas

alex-courtis commented 2 years ago

The messages use the same schema as cfg.yaml and there are currently 4 requests: CFG_GET, CFG_SET, CFG_DEL, CFG_WRITE

I'll put together a document with details on how each of those works, a standalone example client, as well as how to marshal requests and unmarshal responses with examples.

You can see the last three using the client: send a request with debug enabled e.g. way-displays -L debug -s scale "Unknown 0x05EF" 2.5 will show:

CFG_SET:
  SCALE:
    - NAME_DESC: Unknown 0x05EF
      SCALE: 2.5

CFG_GET returns human readable messages. We need to add functionality to return the raw data, but that is simple and can be added at the same time as the example client.

alex-courtis commented 2 years ago

State queries will also need to be added, say, HEADS_GET and LID_GET or maybe just DISPLAY_GET. Mutations would still be done via CFG_*.

alex-courtis commented 2 years ago

Branch 49-yaml-schemas has been created which documents and completes the API.

IPC API YAML Schemas standalone example client: make example-client; ./example-client

It's not yet merged as there are a couple of niggles around the human printed messages, however it is functionally complete.

I'm excited... what's the application @limbo127 ?

alex-courtis commented 2 years ago

Released 1.6.0

Doc: IPC, YAML_SCHEMAS

limbo127 commented 2 years ago

Hello, sorry for the delay, I cannot get the time to try it . We have a small linux distribution for our client, with minimal gui, just a task bar. Thanks, I think we can use ipc at september. Regards,

alex-courtis commented 2 years ago

Hello, sorry for the delay, I cannot get the time to try it . We have a small linux distribution for our client, with minimal gui, just a task bar. Thanks, I think we can use ipc at september. Regards,

Fantastic. Let me know if you need any assstance.