diff --git a/README.md b/README.md index fd7be1a..71a735d 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,17 @@ To add the current task to Waybar, add this snippet to your config: ``` 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.: +you can change the `exec` command to invoke `emacsclient` directly. Note that, since Emacsclient +can’t 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.: ```json "custom/org": { "format": " {}", "return-type": "json", "restart-interval": 5, - "exec": "emacsclient --eval '(org-clock-waybar-ouptut-task)'" + "exec": "emacsclient --eval '(org-clock-waybar-ouptut-task)' | jq fromjson" } ``` diff --git a/org-clock-waybar.el b/org-clock-waybar.el index 4adf4f2..0df8469 100644 --- a/org-clock-waybar.el +++ b/org-clock-waybar.el @@ -101,7 +101,7 @@ value of `org-clock-waybar-not-clocked-in-text'." This function is ought to be used via Emacsclient: emacsclient --eval '(org-clock-waybar-output-task)'" - (print (org-clock-waybar--get-clocked-task-json))) + (org-clock-waybar--get-clocked-task-json)) (defun org-clock-waybar-setup () "Setup org-clock-waybar.