It's a hacked-in-a-afternoon solution, but the gist is that I run a server in Emacs based on the emacs-web-server package[0], and I wrote some scripts that request to them.
I used Better Touch Tool[1] to add the buttons that execute the scripts.
[0] https://github.com/eschulte/emacs-web-server
[1] https://folivora.ai