11 Commits

Author SHA1 Message Date
300574fff4 Remove declared org-mode dep 2026-02-03 09:50:24 +00:00
514e3a813c 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.
2026-02-03 09:50:24 +00:00
dda3fc6eb0 Some more tweaks 2026-02-03 09:50:24 +00:00
629a9e335e fix typo 2026-02-03 09:50:24 +00:00
f281941cca Make the xdg dependency optional
We now default to using `~/.cache/waybar-current-task.json` if the `xdg` package is not present.
2026-02-03 09:50:23 +00:00
8a20f8e8db [Bugfix] Make sure we remove all text properties before outputting JSON data 2026-02-03 09:50:23 +00:00
96772487c4 Do not use org-clock-goto to get tags 2026-02-03 09:50:23 +00:00
lh@hrdl.eu
a23ccff851 Add-hook org-clock-cancel-hook 2026-02-03 09:50:23 +00:00
700027bdd5 Make different parts of the output configurable by setting user functions 2021-03-12 17:58:55 +01:00
1dafd1306e Factor out clocked-out title generation to get-task-title 2021-03-12 17:58:12 +01:00
2d820dbf87 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.
2021-03-12 17:58:10 +01:00

View File

@@ -7,7 +7,7 @@
;; Keywords: org, clocking, waybar ;; Keywords: org, clocking, waybar
;; URL: https://gitea.polonkai.eu/gergely/org-clock-waybar ;; URL: https://gitea.polonkai.eu/gergely/org-clock-waybar
;; Package-Version: 1.0 ;; Package-Version: 1.0
;; Package-Requires: ((emacs "26.1") (org "9")) ;; Package-Requires: ((emacs "26.1"))
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; 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. 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 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'." value of `org-clock-waybar-not-clocked-in-text'."
(let* ((text-func (or (and (fboundp ('org-clock-waybar-text-function))) (let* ((text-func (or 'org-clock-waybar-text-function
#'org-clock-waybar-get-task-title)) 'org-clock-waybar-get-task-title))
(text (funcall text-func)) (text (funcall text-func))
(alt-func (or (and (fboundp ('org-clock-waybar-alt-function))) (alt-func (or 'org-clock-waybar-alt-function
#'org-clock-waybar-get-task-category)) 'org-clock-waybar-get-task-category))
(alt (funcall alt-func)) (alt (funcall alt-func))
(tooltip-func (or (and (fboundp ('org-clock-waybar-tooltip-function))) (tooltip-func (or 'org-clock-waybar-tooltip-function
#'org-clock-waybar-get-tooltip)) 'org-clock-waybar-get-tooltip))
(tooltip (funcall tooltip-func)) (tooltip (funcall tooltip-func))
(class-func (or (and (fboundp ('org-clock-waybar-class-function))) (class-func (or 'org-clock-waybar-class-function
#'org-clock-waybar-get-tags)) 'org-clock-waybar-get-tags))
(class (funcall class-func)) (class (funcall class-func))
(percentage (when (fboundp 'org-clock-waybar-percentage-function) (percentage (when (fboundp 'org-clock-waybar-percentage-function)
(funcall #'org-clock-waybar-percentage-function))) (funcall 'org-clock-waybar-percentage-function)))
(output (json-new-object))) (output (json-new-object)))
(or (null text) (or (null title)
(stringp text) (stringp title)
(error "Text must be a string (org-clock-waybar)!")) (error "Title must be a string (org-clock-waybar)!"))
(or (null alt) (or (null alt)
(stringp alt) (stringp alt)
(error "Alt text must be a string (org-clock-waybar)!")) (error "Alt text must be a string (org-clock-waybar)!"))