I’ve looked into this and it doesn’t seem possible.
Things such as xdotool
won’t work as the SysRq key isn’t handled by Xorg and things like /dev/uinput or /proc/sysrq-trigger requires root access already.
It seems like SysRq requires a local keyboard to be connected.
The k
command only kills programs on the current virtual console so it wouldn’t be able to kill X as it’s not running on the one you switched to.
I don’t think X can mess with other virtual consoles anyway.