2023-12-30 09:02:22 +01:00
2023-12-30 09:02:22 +01:00
2023-12-30 08:53:39 +01:00
2023-12-30 08:53:39 +01:00
2023-12-30 08:53:39 +01:00
2023-11-24 23:17:18 +01:00
2023-12-30 08:53:39 +01:00
2023-12-30 09:02:22 +01:00

riverguile

Layout generator for the river Wayland server which uses Guile Scheme for layouts. Its layout namespace is riverguile.

Uppon launch, riverguile tries to load a scheme script and checks the following paths for it in the given order:

  • layout.scm
  • $XDG_CONFIG_HOME/river/layout.scm
  • $HOME/.config/river/layout.scm
  • /etc/riverguile/layout.scm

In the context of this script, a special procedure (install-handler key proc) is available, which can be used to install handlers to certain events. Check the man page for more information.

Here is an example layout.scm file replicating rivertiles behavior of having a main window and a stack of windows aside:

(define split 0.55)

(define (layout:rows n x y w h)
        (letrec ((height (/ h n))
                 (rows (lambda (n)
                               (if (eq? n 0)
                                   '()
                                   (let ((Y (- (+ y h) (* n height))))
                                        (append (list (list x Y w height))
                                                (rows (- n 1))))))))
                (rows n)))

(define (layout:split n x y w h)
        (if (eq? n 1)
            (list (list x y w h))
            (letrec* ((left (* split w))
                      (right (- w left)))
                     (append (list (list x y left h))
                             (layout:rows (- n 1) (+ x left) y right h)))))

(install-handler 'layout-demand (lambda (view-count width height tags output)
                                  (layout:split view-count 0 0 width height)))
Languages
C 87.2%
Scheme 7.8%
Makefile 3.5%
Nix 1.5%