13 Commits

Author SHA1 Message Date
17b05377b9 try a different quoting 2026-02-04 13:52:19 +00:00
a192128d0d Make different parts of the output configurable by setting user functions 2026-02-04 13:51:56 +00:00
837a85f47b Factor out clocked-out title generation to get-task-title 2026-02-04 13:51:56 +00:00
36d515d3dc Rename most functions to remove the double dashes
This naming convention denotes “private” functions; however, if we want to introduce more
customization, we should make these available and documented well.
2026-02-04 13:51:48 +00:00
e51d2f2f6c Fix dependency name
Org mode’s package is called `org`, not `org-mode`.
2026-02-04 14:49:14 +01:00
c22231dfa1 Move URL in the header higher so Package-Requires becomes the last keyword
Apparently, `package-read-from-string` doesn’t like it the old way.
2025-05-18 13:24:12 +02:00
1c922fd4b4 Some more tweaks 2025-02-27 12:03:42 +00:00
d5a776c761 fix typo 2025-02-27 11:53:10 +00:00
c327eb18c6 Make the xdg dependency optional
We now default to using `~/.cache/waybar-current-task.json` if the `xdg` package is not present.
2023-01-31 08:47:36 +01:00
754fd9d2fa Merge pull request '[Bugfix] Make sure we remove all text properties before outputting JSON data' (#8) from remove-text-properties into main
Reviewed-on: gergely/org-clock-waybar#8
2021-10-16 10:24:06 +00:00
a144ee13c0 [Bugfix] Make sure we remove all text properties before outputting JSON data 2021-10-16 06:25:34 +02:00
612c0d1e31 Do not use org-clock-goto to get tags 2021-03-29 10:20:01 +01:00
lh@hrdl.eu
3e71766f85 Add-hook org-clock-cancel-hook 2021-03-13 16:01:43 +01:00

View File

@@ -7,7 +7,7 @@
;; Keywords: org, clocking, waybar
;; URL: https://gitea.polonkai.eu/gergely/org-clock-waybar
;; Package-Version: 1.0
;; Package-Requires: ((emacs "26.1"))
;; Package-Requires: ((emacs "26.1") (org "9"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -148,24 +148,24 @@ When nil, the percentage text will be an empty string."
The output is in JSON format constructed in a way so Waybar can process it.
If there is no clocked in task, alt becomes empty and text will be set to the
value of `org-clock-waybar-not-clocked-in-text'."
(let* ((text-func (or 'org-clock-waybar-text-function
'org-clock-waybar-get-task-title))
(let* ((text-func (or (and (fboundp ('org-clock-waybar-text-function)))
#'org-clock-waybar-get-task-title))
(text (funcall text-func))
(alt-func (or 'org-clock-waybar-alt-function
'org-clock-waybar-get-task-category))
(alt-func (or (and (fboundp ('org-clock-waybar-alt-function)))
#'org-clock-waybar-get-task-category))
(alt (funcall alt-func))
(tooltip-func (or 'org-clock-waybar-tooltip-function
'org-clock-waybar-get-tooltip))
(tooltip-func (or (and (fboundp ('org-clock-waybar-tooltip-function)))
#'org-clock-waybar-get-tooltip))
(tooltip (funcall tooltip-func))
(class-func (or 'org-clock-waybar-class-function
'org-clock-waybar-get-tags))
(class-func (or (and (fboundp ('org-clock-waybar-class-function)))
#'org-clock-waybar-get-tags))
(class (funcall class-func))
(percentage (when (fboundp 'org-clock-waybar-percentage-function)
(funcall 'org-clock-waybar-percentage-function)))
(funcall #'org-clock-waybar-percentage-function)))
(output (json-new-object)))
(or (null title)
(stringp title)
(error "Title must be a string (org-clock-waybar)!"))
(or (null text)
(stringp text)
(error "Text must be a string (org-clock-waybar)!"))
(or (null alt)
(stringp alt)
(error "Alt text must be a string (org-clock-waybar)!"))