This segfaults without the thread-sleep added by jcob on Mon Nov 6 19:34:16 2017

(use jsetroot) ; This just wraps a c lib that sets the background

(define home (get-environment-variable "HOME"))

(define framedir (string-append home "/.stumpwm.d/data/frames/"))

(define frames
  (let for ((i 21) (acc '()))
	     (if (>= i 1)
		 (for (- i 1) (cons (string-append framedir (number->string i) ".png") acc))
		 acc)))

(define frameprocs
  (zip (let for ((i 21) (acc '()))
    (if (>= i 1)
	(for (- i 1) (cons (lambda (file) (set-background-image! file)) acc))
	acc)) frames))

(define (set-background-images proclist)
  (let for ((i 21) (fp proclist))
    (if (>= i 1)
	(begin
	  ((car (car fp)) (car (cdr (car fp))))
	  (thread-sleep! 0.05)
	  (for (- i 1) (cdr fp)))
	#t)))