wayvnc/examples
Jim Ramsay a28ce15521 Split wayvnctl output-set into output-set and output-cycle
Rather than optional params, unique commands are easier to use.

This also removes the ability to cycle through in reverse since the list
order is already arbitrary.

Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
2023-01-08 18:23:45 -05:00
..
README.md Add single-output-sway helper script 2022-12-25 21:43:55 -05:00
event-watcher Introduce wayvncctl startup amd shutdown events 2022-11-19 11:58:07 +00:00
single-output-sway Split wayvnctl output-set into output-set and output-cycle 2023-01-08 18:23:45 -05:00

README.md

Example Scripts

The scripts here are examples of how you can automate interesting things with the wayvncctl IPC events.

event-watcher

This is a pretty simple example that just demonstrates how to tie the wayvncctl event-receive event loop into a bash script. It logs when clients connect and disconnect.

single-output-sway

This is more purposeful, and implements an idea for multi-output wayland servers, collapsing all outputs down to one when the first client connects, and restoring the configuration when the last client exits.

The mechanism used to collapse the outputs depends on the version of sway installed:

  • For sway-1.7 and earlier, the script just temporarily disables all outputs except the one being captured. This moves all workspaces to the single remaining output.

  • For sway-1.8 and later, the script creates a temporary virtual output called `HEADLESS-[0-9]+' and then disables all physical outputs, which moves all workspaces to the virtual output. On disconnect, all original physical outputs are re-enabled, and the virtual output is destroyed.