~abcdw/rde

119b8680c0b8ad91aa3808ffd360a562c16d0dfe — Demis Balbach 1 year, 8 months ago 7035634
rde: waybar: Add waybar-custom.
1 files changed, 24 insertions(+), 0 deletions(-)

M src/rde/features/wm.scm
M src/rde/features/wm.scm => src/rde/features/wm.scm +24 -0
@@ 73,6 73,7 @@
            waybar-idle-inhibitor
            waybar-clock
            waybar-battery
            waybar-custom

            feature-swaynotificationcenter
            feature-swayidle


@@ 803,6 804,29 @@ By default, NAME is root, PATH is /, and DISK-ICON is ."
       (path . ,path))
     #:bar-id bar-id)))

(define* (waybar-custom
          #:key
          (bar-id 'main)
          (name 'main)
          (exec #f)
          (return-type "json")
          (icon #f)
          (placement 'modules-right))
  "Executes a custom script EXEC. The script is expected
to return a valid json object."
  (lambda (config)
    (waybar-module
     (symbol-append 'custom/ name)
     `((interval . 2)
       (exec . ,exec)
       (return-type . ,return-type)
       (tooltip . "{tooltip}")
       (format . ,(if icon
                       (string-append icon " {}")
                       "{}")))
     #:bar-id bar-id
     #:placement placement)))

(define* (feature-waybar
          #:key
          (waybar waybar)