2022-10-31 07:22:29 +00:00
|
|
|
wayvncctl(1)
|
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
2022-11-15 09:56:59 +00:00
|
|
|
wayvncctl - A command line control client for wayvnc(1)
|
2022-10-31 07:22:29 +00:00
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
*wayvncctl* [options] [command [--parameter value ...]]
|
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
|
|
|
*-S, --socket=<path>*
|
|
|
|
Set wayvnc control socket path. Default: $XDG_RUNTIME_DIR/wayvncctl
|
|
|
|
or /tmp/wayvncctl-$UID
|
|
|
|
|
2022-11-15 09:57:26 +00:00
|
|
|
*-w, --wait*
|
|
|
|
Wait for wayvnc to start up if it's not already running. Default: Exit
|
|
|
|
immediately with an error if wayvnc is not running.
|
|
|
|
|
2022-11-16 00:57:16 +00:00
|
|
|
*-r,--reconnect*
|
|
|
|
If disconnected while waiting for events, wait for wayvnc to restart and
|
|
|
|
re-register for events. Default: Exit when wayvnc exits.
|
|
|
|
|
2022-11-05 13:53:17 +00:00
|
|
|
*-j, --json*
|
|
|
|
Produce json output to stdout.
|
|
|
|
|
2022-10-31 07:22:29 +00:00
|
|
|
*-V, --version*
|
|
|
|
Show version info.
|
|
|
|
|
|
|
|
*-v,--verbose*
|
|
|
|
Be more verbose.
|
|
|
|
|
|
|
|
*-h, --help*
|
2022-11-06 02:42:24 +00:00
|
|
|
Get help about the wayvncctl command itself (lists these options). Does
|
|
|
|
not connect to the wayvncctl control socket.
|
2022-10-31 07:22:29 +00:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
*wayvnc(1)* allows runtime interaction via a unix socket json-ipc mechanism.
|
|
|
|
This command line utility provides easy interaction with those commands.
|
|
|
|
|
2023-01-06 06:45:36 +00:00
|
|
|
This command is largely self-documenting:
|
2022-10-31 07:22:29 +00:00
|
|
|
|
2023-01-06 06:45:36 +00:00
|
|
|
- Running *wayvncctl --help* lists all supported IPC commands.
|
|
|
|
- Running *wayvncctl command-name --help* returns a description of the given
|
|
|
|
command and its available parameters.
|
|
|
|
- Running *wayvncctl event-receive --help* includes a list of all supported event
|
|
|
|
names.
|
|
|
|
- Running *wayvncctl event-receive --show=event-name* returns a
|
|
|
|
description of the given event and expected data fields.
|
2022-12-06 21:45:51 +00:00
|
|
|
|
2022-11-06 20:05:14 +00:00
|
|
|
# ASYNCHRONOUS EVENTS
|
|
|
|
|
|
|
|
While *wayvncctl* normally terminates after sending one request and receiving
|
|
|
|
the corresponding reply, the *event-receive* command acts differently. Instead
|
2022-11-09 14:11:21 +00:00
|
|
|
of exiting immediately, *wayvncctl* waits for any events from the server,
|
|
|
|
printing each to stdout as they arrive. This mode of operation will block until
|
|
|
|
either it receives a signal to terminate, or until the wayvnc server terminates.
|
|
|
|
|
|
|
|
In _--json_ mode, each event is printed on one line, with a newline character at
|
|
|
|
the end, for ease in scripting:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ wayvncctl --json event-receive
|
2023-12-31 18:03:44 +00:00
|
|
|
{"method":"client-connected","params":{"id":"0x10ef670","address":null,"username":null,"connection_count":1}}
|
|
|
|
{"method":"client-disconnected","params":{"id":"0x10ef670","address":null,"username":null,"connection_count":0}}
|
2022-11-09 14:11:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The default human-readible output is a multi-line yaml-like format, with two
|
|
|
|
newline characters between each event:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ wayvncctl event-receive
|
|
|
|
|
|
|
|
client-connected:
|
|
|
|
id: 0x10ef670
|
2023-12-31 18:03:44 +00:00
|
|
|
address: 192.168.1.18
|
2022-11-09 14:11:21 +00:00
|
|
|
connection_count: 1
|
|
|
|
|
|
|
|
client-disconnected:
|
|
|
|
id: 0x10ef670
|
2023-12-31 18:03:44 +00:00
|
|
|
address: 192.168.1.18
|
2022-11-09 14:11:21 +00:00
|
|
|
connection_count: 0
|
|
|
|
|
|
|
|
```
|
2022-11-06 20:05:14 +00:00
|
|
|
|
2022-11-19 02:45:28 +00:00
|
|
|
## SPECIAL LOCAL EVENT TYPES
|
|
|
|
|
|
|
|
Especially useful when using _--wait_ or _--reconnect_ mode, wayvncctl will
|
|
|
|
generate 2 additional events not documented in *wayvnc(1)*:
|
|
|
|
|
|
|
|
*wayvnc-startup*
|
|
|
|
Sent when a successful wayvnc control connection is established and
|
|
|
|
event registration has succeeded, both upon initial startup and on
|
|
|
|
subsequent registrations with _--reconnect_.
|
|
|
|
|
|
|
|
No paramerers.
|
|
|
|
|
|
|
|
*wayvnc-shutdown*
|
|
|
|
Sent when the wayvnc control connection is dropped, usually due to
|
|
|
|
wayvnc exiting.
|
|
|
|
|
|
|
|
No paramerers.
|
|
|
|
|
2022-10-31 07:22:29 +00:00
|
|
|
# EXAMPLES
|
|
|
|
|
2023-01-06 20:44:39 +00:00
|
|
|
Get help on the "output-set" IPC command:
|
2022-10-31 07:22:29 +00:00
|
|
|
|
|
|
|
```
|
2023-01-06 20:44:39 +00:00
|
|
|
$ wayvncctl output-set --help
|
2023-01-06 21:24:20 +00:00
|
|
|
Usage: wayvncctl [options] output-set <output-name> [params]
|
2023-01-06 06:45:36 +00:00
|
|
|
...
|
2022-10-31 07:22:29 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Cycle to the next active output:
|
|
|
|
|
|
|
|
```
|
2023-01-06 20:59:02 +00:00
|
|
|
$ wayvncctl output-cycle
|
2022-11-06 02:42:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Get json-formatted version information:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ wayvncctl --json version
|
|
|
|
{"wayvnc":"v0.5.0","neatvnc":"v0.5.1","aml":"v0.2.2"}
|
2022-10-31 07:22:29 +00:00
|
|
|
```
|
|
|
|
|
2022-11-11 06:43:02 +00:00
|
|
|
A script that takes an action for each client connect and disconnect event:
|
|
|
|
|
|
|
|
```
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
connection_count_now() {
|
2022-11-19 02:45:28 +00:00
|
|
|
echo "Total clients: $1"
|
2022-11-11 06:43:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
while IFS= read -r EVT; do
|
|
|
|
case "$(jq -r '.method' <<<"$EVT")" in
|
|
|
|
client-*onnected)
|
|
|
|
count=$(jq -r '.params.connection_count' <<<"$EVT")
|
|
|
|
connection_count_now "$count"
|
|
|
|
;;
|
2022-11-19 02:45:28 +00:00
|
|
|
wayvnc-shutdown)
|
|
|
|
connection_count_now 0
|
|
|
|
;;
|
2022-11-11 06:43:02 +00:00
|
|
|
esac
|
2022-11-16 00:57:16 +00:00
|
|
|
done < <(wayvncctl --wait --reconnect --json event-receive)
|
2022-11-11 06:43:02 +00:00
|
|
|
```
|
|
|
|
|
2022-10-31 07:22:29 +00:00
|
|
|
# ENVIRONMENT
|
|
|
|
|
|
|
|
The following environment variables have an effect on wayvncctl:
|
|
|
|
|
|
|
|
_XDG_RUNTIME_DIR_
|
|
|
|
Specifies the default location for the wayvncctl control socket.
|
|
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
|
|
|
*wayvnc(1)*
|