2021-03-11 04:58:49 +00:00
|
|
|
|
# org-clock-waybar – Export the currently clocked-in task to be displayed on Waybar
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
Put `org-clock-waybar.el` somewhere in your `load-path`, and `(require 'org-clock-waybar)`.
|
|
|
|
|
|
|
|
|
|
MELPA version may come soon.
|
|
|
|
|
|
2021-03-11 05:14:54 +00:00
|
|
|
|
You can set the file to be written by customizing `org-clock-waybar-filename`; it defaults to
|
|
|
|
|
`$XDG_CACHE_HOME/waybar-current-task.json` (`$XDG_CACHE_HOME` defaults to `$HOME/.cache` on XDG
|
|
|
|
|
compatible systems, like Linux.)
|
2021-03-11 04:58:49 +00:00
|
|
|
|
|
|
|
|
|
## Waybar configuration
|
|
|
|
|
|
|
|
|
|
To add the current task to Waybar, add this snippet to your config:
|
|
|
|
|
|
2021-03-11 05:14:54 +00:00
|
|
|
|
```json
|
2021-03-11 04:58:49 +00:00
|
|
|
|
"custom/org": {
|
|
|
|
|
"format": " {}",
|
|
|
|
|
"return-type": "json",
|
|
|
|
|
"restart-interval": 5,
|
|
|
|
|
"exec": "cat /home/yourusername/.cache/waybar-current-task.json"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2021-03-11 05:14:54 +00:00
|
|
|
|
If you use Emacs as a daemon (e.g. starting it as `emacs --daemon` or calling `(server-start)`),
|
|
|
|
|
you can change the `exec` command to invoke `emacsclient` directly. In this case, no output file
|
|
|
|
|
will be written.:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
"custom/org": {
|
|
|
|
|
"format": " {}",
|
|
|
|
|
"return-type": "json",
|
|
|
|
|
"restart-interval": 5,
|
|
|
|
|
"exec": "emacsclient --eval '(org-clock-waybar-ouptut-task)'"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then, add `custom/org` to `modules-left`/`modules-center`/`module-right` if your bar’s
|
|
|
|
|
configuration. You can find a minimal working configuration in the [`examples`](./examples)
|
|
|
|
|
directory.
|
2021-03-11 05:14:48 +00:00
|
|
|
|
|
|
|
|
|
## Customization
|
|
|
|
|
|
|
|
|
|
To see a list of configurable parts, use `M-x customize-group <RET> org-clock-waybar`.
|