Factor out clocked-out title generation to get-task-title
This commit is contained in:
parent
2d820dbf87
commit
1dafd1306e
@ -66,7 +66,9 @@
|
|||||||
|
|
||||||
(defsubst org-clock-waybar-get-task-title ()
|
(defsubst org-clock-waybar-get-task-title ()
|
||||||
"Get the title of TASK."
|
"Get the title of TASK."
|
||||||
(when (org-clocking-p) (substring-no-properties org-clock-current-task)))
|
(if (org-clocking-p)
|
||||||
|
(substring-no-properties org-clock-current-task)
|
||||||
|
org-clock-waybar-not-clocked-in-text))
|
||||||
|
|
||||||
(defsubst org-clock-waybar-get-task-category ()
|
(defsubst org-clock-waybar-get-task-category ()
|
||||||
"Get the category of TASK."
|
"Get the category of TASK."
|
||||||
@ -99,10 +101,7 @@ value of `org-clock-waybar-not-clocked-in-text'."
|
|||||||
(tooltip (org-clock-waybar-get-tooltip))
|
(tooltip (org-clock-waybar-get-tooltip))
|
||||||
(class (org-clock-waybar-get-tags))
|
(class (org-clock-waybar-get-tags))
|
||||||
(output (json-new-object)))
|
(output (json-new-object)))
|
||||||
(setq output (json-add-to-object
|
(setq output (json-add-to-object output "text" (or title "")))
|
||||||
output
|
|
||||||
"text"
|
|
||||||
(or title org-clock-waybar-not-clocked-in-text)))
|
|
||||||
(setq output (json-add-to-object output "alt" (or category "")))
|
(setq output (json-add-to-object output "alt" (or category "")))
|
||||||
(setq output (json-add-to-object output "tooltip" (or tooltip "")))
|
(setq output (json-add-to-object output "tooltip" (or tooltip "")))
|
||||||
(setq output (json-add-to-object output "class" (or class "")))
|
(setq output (json-add-to-object output "class" (or class "")))
|
||||||
|
Loading…
Reference in New Issue
Block a user