Add more config options and a tooltip

This commit is contained in:
2021-03-11 15:50:47 +00:00
parent 4a3c4b549e
commit 92f896af05
2 changed files with 40 additions and 7 deletions

View File

@@ -23,19 +23,42 @@ To add the current task to Waybar, add this snippet to your config:
}
```
You can also display an icon specific to the clocked tasks category with the `format-icons` key:
```json
"custom/org": {
"format": "{icon} {}",
"return-type": "json",
"restart-interval": 1,
"format-icons": {
"refile": "",
"ToDo": "",
},
"exec": "cat /home/yourusername/.cache/waybar-current-task.json"
}
```
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. 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.:
have to pipe the output through `jq fromjson`.
If you run emacs in this mode you can also eval commands on click, middle click or scroll.:
```json
"custom/org": {
"format": " {}",
"return-type": "json",
"restart-interval": 5,
"exec": "emacsclient --eval '(org-clock-waybar-ouptut-task)' | jq fromjson"
}
"format": "{icon} {}",
"return-type": "json",
"restart-interval": 1,
"format-icons": {
"refile": "",
"ToDo": "",
},
"exec": "emacsclient --eval '(org-clock-waybar-ouptut-task)' | jq fromjson --unbuffered --compact-output",
"on-click": "emacsclient --eval '(org-clock-out)'",
"on-middle-click": "emacsclient --eval '(org-clock-in-last)'",
},
```