I think you’d write a script that turns standard output from something like khal to an image, then use a feh command to turn it into your background. But honestly it’s pretty fast to set up a keyboard shortcut to launch a terminal session and type khal.