mmsg(1)

NAME
mmsg - send commands to the mango Wayland compositor and receive JSON responses

SYNOPSIS
mmsg <command> [args...]
mmsg --help | -h | help

DESCRIPTION
mmsg connects to a running mango(1) compositor via the UNIX domain socket specified by the MANGO_INSTANCE_SIGNATURE environment variable. It sends the given command and prints the JSON reply to standard output. In watch mode it keeps the connection open and prints a stream of updates as they occur.

If --help, -h or help is given, a complete usage summary is printed and the program exits with success.

COMMANDS

  One-shot queries (get)
All get commands print a single JSON object and then close the connection.

get version
    Return compositor version.

get cursorpos
    Return the global pointer position (x, y) and the monitor under it (null if over no output).

get keymode
    Return current keymode.

get keyboardlayout
    Return current keyboard layout.

get last_open_surface [monitor]
    Return the last open surface (application) for the given monitor. If monitor is omitted the focused monitor is used.

get monitor <name>
    Return details of the named monitor.

get focusing-client
    Return details of the currently focused client.

get client <id>
    Return details of the client with the given numeric ID.

get tag <monitor> <index>
    Return details of a specific tag (1-based index) on the named monitor.

get all-clients
    List all clients.

get all-monitors
    List all monitors.

get all-tags
    List tags for all monitors.

get tags <monitor>
    List tags for a specific monitor.

dispatch <func>[,arg...] [client,<id>]
    Invoke an internal compositor function. The function name and its arguments are separated by commas. Optionally add client,<id> (before or after the function) to target a specific client.
    Examples:

    •   mmsg dispatch togglefloating

    •   mmsg dispatch movewin,10,100

    •   mmsg dispatch movewin,10,100 client,4

  Persistent streams (watch)
Watch commands keep the connection open and continuously output JSON updates. The initial state is sent immediately, followed by updates whenever relevant changes occur.

watch monitor <name>
    Stream updates for the named monitor.

watch focusing-client
    Stream updates for the focused client.

watch client <id>
    Stream updates for the client with the given ID.

watch tags <monitor>
    Stream tag updates for the named monitor.

watch all-monitors
    Stream updates for all monitors.

watch all-tags
    Stream updates for all tags.

watch all-clients
    Stream updates for all clients.

watch keymode
    Stream keymode changes.

watch keyboardlayout
    Stream keyboard layout changes.

watch last_open_surface [monitor]
    Stream last open surface changes for a specific monitor (or the focused one).

ENVIRONMENT

MANGO_INSTANCE_SIGNATURE
    Path to the compositor's IPC socket. Set automatically by mango(1). If unset, mmsg prints an error and exits.

EXIT STATUS

0   Success (or help message printed).

EXIT_FAILURE
    An error occurred (connection refused, send/receive error, etc.).

SEE ALSO
mango(1)

BUGS
Report issues at the project's issue tracker.