From 119b8680c0b8ad91aa3808ffd360a562c16d0dfe Mon Sep 17 00:00:00 2001 From: Demis Balbach Date: Sun, 26 Mar 2023 21:57:17 +0200 Subject: [PATCH] rde: waybar: Add waybar-custom. --- src/rde/features/wm.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/rde/features/wm.scm b/src/rde/features/wm.scm index f73163f1..d84619f0 100644 --- a/src/rde/features/wm.scm +++ b/src/rde/features/wm.scm @@ -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) -- 2.45.2