#!@GUILE@ \
--no-auto-compile -e main
!#
(use-modules (oop goops)
             (ice-9 format)
             (wayland client display)
             (wayland client protocol wayland))

(define (main . _)
  (let* ((w-display (wl-display-connect))
         (registry (wl-display-get-registry w-display))
         (listener (make <wl-registry-listener>
                     #:global
                     (lambda (data registry name interface version)
                       (format #t "interface: '~a', version: ~a, name: ~a~%"
                               interface version name))
                     #:global-remove
                     (lambda (data registry name)
                       (format #t "removed: ~a~%" name)))))
    (wl-registry-add-listener registry listener)
    (while #t
      (wl-display-dispatch w-display))))
