wayvnc/examples/event-watcher

17 lines
398 B
Bash
Executable File

#!/bin/bash
WAYVNCCTL=${WAYVNCCTL:-wayvncctl}
connection_count_now() {
echo "Total clients: $count"
}
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"
;;
esac
done < <("$WAYVNCCTL" --wait --reconnect --json event-receive)