Add more config options and a tooltip #1

Merged
gergely merged 2 commits from Cadair/org-clock-waybar:main into main 2021-03-11 16:43:28 +00:00
Contributor
No description provided.
Cadair reviewed 2021-03-11 11:11:41 +00:00
@ -64,16 +64,34 @@
'emacs-mule)
"Coding system of the file `org-clock-waybar-filename'.")
(defun org-clock-waybar-text ()
Author
Contributor

I split these into functions so they can be overriden if people want to customise the content? Is this the best way to achieve that?

I split these into functions so they can be overriden if people want to customise the content? Is this the best way to achieve that?
Owner

Yeah, i’d probably make that actually customizable, like have these as defcustom variables, each of which can have symbols as values:

  • 'title means the task’s title
  • 'category means the task’s category
  • 'clock-in-time means the clock in time
  • 'clocked-time means the time since clocking in

Later we might add new symbols here, obviously.

Thus, users can do something like this:

(setq org-clock-waybar-text 'title)
(setq org-clock-waybar-alt 'category)
(setq org-clock-waybar-tooltip 'clocked-time)

Also (on the longer run), these values might get a function as a value, which should return a string, so users can customize stuff to the deepest depths 😄

Yeah, i’d probably make that *actually customizable*, like have these as `defcustom` variables, each of which can have symbols as values: - `'title` means the task’s title - `'category` means the task’s category - `'clock-in-time` means the clock in time - `'clocked-time` means the time since clocking in Later we might add new symbols here, obviously. Thus, users can do something like this: ``` (setq org-clock-waybar-text 'title) (setq org-clock-waybar-alt 'category) (setq org-clock-waybar-tooltip 'clocked-time) ``` Also (on the longer run), these values might get a function as a value, which should return a string, so users can customize stuff to the deepest depths 😄
Author
Contributor

Can you compose multiple of those things together into one line though? So you could have the tooltip be "category: [clock-in-time] title (clocked-time)" or something?

Can you compose multiple of those things together into one line though? So you could have the tooltip be `"category: [clock-in-time] title (clocked-time)"` or something?
Cadair reviewed 2021-03-11 11:27:41 +00:00
README.md Outdated
@ -27,4 +48,3 @@
you can change the `exec` command to invoke `emacsclient` directly. Note that, since Emacsclient
cant actually write stuff to the terminal, it will output an Emacs string full of backslashes
(see [this Emacs SE answer for details](https://emacs.stackexchange.com/a/28668/507)); thus, you
have to pipe the output through `jq fromjson`. In this case, no output file will be written.:
Author
Contributor

A file will still be written?

A file will still be written?
Owner

No, if you call (org-clock-waybar-output-task), the JSON file won’t be written (well, not unless you explicitly added org-clock-waybar-save-task to org-clock-in-hook; the two are completely independent from each other).

No, if you call `(org-clock-waybar-output-task)`, the JSON file won’t be written (well, not unless you explicitly added `org-clock-waybar-save-task` to `org-clock-in-hook`; the two are completely independent from each other).
Author
Contributor

But requiring this file adds the hooks no? So while calling this function doesn't write the file, the hooks are already in place?

But requiring this file adds the hooks no? So while calling this function doesn't write the file, the hooks are already in place?
Cadair force-pushed main from 5342814803 to bc61218f92 2021-03-11 15:51:37 +00:00 Compare
gergely merged commit bc61218f92 into main 2021-03-11 16:43:28 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gergely/org-clock-waybar#1
No description provided.