I am aware of assigning a shortcut normally in XFCE (Keyboard >> Application Shortcuts >> + Add >> command: qvm-run -q -- VM command …) that will work. But it takes considerabily more time to run the script than if executed the command in the VM terminal.
I’m thinking of a command to run in dom0 that passes key press to the VM instead, and then utilize e.g. xbindkeys in the VM to bind the shortcut normally. I searched for the command to run in dom0 that would do so, but couldn’t find…
Note: I do want this to function without having a window of the VM running.
An easier way to shave off quite a lot of latency is to use qrexec-client directly instead of through the qvm-run wrapper:
If you don’t care about the command’s stdout / stderr / exit status, you can even use qrexec-client -e to just fire it off asynchronously (which has no qvm-run equivalent), like here.