dbordak / telephone-line

A new implementation of Powerline for Emacs
GNU General Public License v3.0
560 stars 49 forks source link

Org-clock segment possible? #107

Open dotinspace opened 5 years ago

dotinspace commented 5 years ago

I cannot seem to manage defining a segment to display org-clock. When I add a custom segment, absolutely nothing happens.

Currently, I have the following defined:

  (telephone-line-defsegment my-org-clock-segment ()
       (format "%s" (org-timer-mode-line-string)))
  (add-hook 'org-clock-out-hook
            '(lambda ()
               (setq org-timer-mode-line-string nil)
               (force-mode-line-update)))

Any pointers would be highly appreciated.

Olivia5k commented 4 years ago

This is mine, which I've been using for a long time;

(telephone-line-defsegment th/telephone-clock-segment ()
  (when (telephone-line-selected-window-active)
    ;; The org-clocking-p function isn't necessarily loaded until we start
    ;; actually clocking something.
    (if (and (functionp 'org-clocking-p) (org-clocking-p))
        (org-clock-get-clock-string)
      "")))

It only shows the segment in your currently active buffer's modeline, and it contains the clock and which task you're working on;

20200506 085825-dragonisle