> I just want every JACK client to alternate between speakers and
> headphones when I press a keyboard shortcut.
You could *almost* do that with jack-matchmaker by defining connection
patterns in two files, copy the file with the configuration you want at
the moment to the file given to jack-matchmaker with the --pattern-file
option ad then send a HUP signal to its process to get it to re-read the
Alas, jack-matchmaker never disconnect existing connections. But maybe
you can take some inspiration from the code.
It uses its own Python-JACK interface (based on ctypes, stolen from
Cadence). I would probably use python-jack instead today: