Skip to content
Alexander Courtis edited this page Nov 20, 2023 · 5 revisions

way-displays server creates a socket ${XDG_RUNTIME_DIR}/way-displays.${XDG_VTNR}.sock for interprocess communications.

$WAYLAND_DISPLAY must be set and $XDG_VTNR set to match the server's. If $XDG_RUNTIME_DIR is unset the socket will be /tmp/way-displays.${XDG_VTNR}.sock.

Clients send an [!!ipc_request](./YAML Syntax.md#ipc_request) and will receive a sequence of [!!ipc_response](./YAML Syntax.md#ipc_response) until the operation is complete and the socket closed.

Response

[STATE](./YAML Syntax#state) contains the device states.

[CFG](./YAML Syntax#cfg) contains the active configuration.

MESSAGES contains human readable messages by [!!log_threshold](./YAML Syntax#log_threshold) as written by the server. These are intended to be streamed to the user.

DONE will be set when the operation is complete.

[RC](./YAML Syntax#cfg) 0 until DONE.

Request

An [!!ipc_request](./YAML Syntax#ipc_request) must contain one [COMMAND](./YAML Syntax#ipc_command).

GET

Retrieve [CFG](./YAML Syntax#cfg) and [STATE](./YAML Syntax#state)

OP: GET

Only one response will be sent and it will not be in a sequence.

CFG_WRITE

Persists the active configuration to cfg.yaml:

OP: CFG_WRITE

CFG_SET

Mutate multiple configuration values.

[CFG](./YAML Syntax#cfg) containing only the desired elements to change e.g.:

OP: CFG_SET
CFG:
  SCALING: OFF
  ORDER:
    - "one"
    - "two"

CFG_DEL

Remove multiple configuration values.

Only these [CFG](./YAML Syntax#cfg) elements that may be deleted:

  • SCALE
  • MODE
  • DISABLED
  • VRR_OFF

[CFG](./YAML Syntax#cfg) containing only the desired elements to delete e.g.:

OP: CFG_DEL
CFG:
  SCALE:
    - NAME_DESC: DEF 456
      SCALE: 1
  MODE:
    - NAME_DESC: GHI 789
  DISABLED:
    - PQR 678
    - STU 901
    - eDP-1

Examples

make examples

client-get-raw

Sends a GET and prints the raw response.

client-set-scaling

Sends a CFG_SET to reset SCALING. Unpacks all responses and prints some config and head states as the operation progresses.

poke-server

Validates and prints client and server readiness for IPC.

Clone this wiki locally