~abcdw/rde-devel

rde: waybar: Add waybar-custom. v1 PROPOSED

Demis Balbach: 1
 rde: waybar: Add waybar-custom.

 1 files changed, 22 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/40008/mbox | git am -3
Learn more about email & git

[PATCH] rde: waybar: Add waybar-custom. Export this patch

---
 src/rde/features/wm.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/rde/features/wm.scm b/src/rde/features/wm.scm
index d86f4a0..58e3343 100644
--- a/src/rde/features/wm.scm
+++ b/src/rde/features/wm.scm
@@ -71,6 +71,7 @@
            waybar-idle-inhibitor
            waybar-clock
            waybar-battery
            waybar-custom

            feature-swayidle
            feature-swaylock
@@ -762,6 +763,27 @@ 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))
  "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)))

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