Add the org-clock-waybar-output-task function

It outputs the generated JSON string to the standard output so it can
be used directly from the command line, e.g. using `emacsclient`.
This commit is contained in:
2021-03-11 06:14:54 +01:00
parent bf9c74666d
commit cf030fa8d5
2 changed files with 29 additions and 3 deletions

View File

@@ -95,6 +95,14 @@ value of `org-clock-waybar-not-clocked-in-text'."
(insert (org-clock-waybar--get-clocked-task-json))
(write-file org-clock-waybar-filename)))
(defun org-clock-waybar-ouptut-task ()
"Output the current task in JSON format Waybar can understand.
This function is ought to be used via Emacsclient:
emacsclient --eval '(org-clock-waybar-output-task)'"
(print (org-clock-waybar--get-clocked-task-json)))
(defun org-clock-waybar-setup ()
"Setup org-clock-waybar.