Skip to content
tanalab2 edited this page Aug 26, 2018 · 8 revisions

Display pomodoro's in agenda clock report

You can make emacs show pomodoro count in your agenda clock report.

(setq org-agenda-clockreport-parameter-plist 
 '(:fileskip0 t :link t :maxlevel 2 :formula "$5=($3+$4)*(60/25);t"))

See: http://emacs.stackexchange.com/questions/12839/use-formula-in-agenda-clockreport-to-convert-time

Switching between tasks during a pomodoro

To switch between tasks in the middle of a pomodoro, you can use org-clock-in. The pomodoro will continue and org will add the time to the previous time and clock-out the new task.

Break time and pomodoro time progress timer on Linux

You can add hooks to org-pomodoro to run external processes. This can be used to run external progress bars if you wish.

Add the following to your .emacs:

(add-hook 'org-pomodoro-finished-hook
  (lambda ()
    (interactive)
    (call-process "yadKill")
    (start-process-shell-command "yad Break timers command" nil "yadBreakTime")
    ))  
(add-hook 'org-pomodoro-started-hook
  (lambda ()
    (interactive)  
    ;Kill of old break timer window if it exist.
    (call-process "yadKill")
    (start-process-shell-command "yad Break timers command" nil "yadBottomProgressBar")
    ))   

Now create three bash scripts and place them into your path:

yadBottomProgressBar

xpixels=$(xrandr --current | grep "Screen" | cut -d ',' -f2 | cut -d ' ' -f3) #grab total x of combined monitors.
xposOfYad=$(expr $xpixels  / 2 - 154)  #place in the middle of total space.
ypixels=$(xrandr --current | grep "Screen" | cut -d ',' -f2 | cut -d ' ' -f5)
yPosOfYad=$(expr $ypixels + 10)
echo $xposOfYad " " $yPosOfYad
yad --on-top --sticky --info --text="$*" --timeout=1500 --timeout-indicator=top --text-align=center --no-buttons --center --undecorated --geometry=50x5+$xposOfYad+$yPosOfYad

yadBreakTime

 #!/bin/sh 
xpixels=$(xrandr --current | grep "Screen" | cut -d ',' -f2 | cut -d ' ' -f3) #grab total x of combined monitors.
xposOfYad=$(expr $xpixels  / 2 - 400)  #place in the middle of total space.
yad --on-top --sticky --info --text="$*" --timeout=300 --timeout-indicator=bottom --text-align=center --no-buttons --center --undecorated --geometry=800x50+$xposOfYad+-5

yadKill

pkill yad

Now it'll open progress bars for when a pomodoro starts. the yadKill is useful if you start a pomodoro before finishing a break. The break/progress bars can be closed by pressing escape on them.
For positioning, see the --geometry property and man pages. also inspect the xrandr output to customize to your needs.

Activating emacs
You may find that yad steals focus. In that case you can append some lines in the yad script to re-activate emacs with xdotool

sleep 0.1
xdotool search --onlyvisible --class emacs windowactivate

Display pomodoro in system panel

Requirements

Steps

  1. put this function into your emacs config
(defun my/org-pomodoro-text-time ()
  "Return status info about org-pomodoro and if org-pomodoro is not running, try to print info about org-clock.
    If either org-pomodoro or org-clock aren't active, print \"No Active Task \" "
  (interactive)
  (cond ((equal :none org-pomodoro-state)
         (if (org-clock-is-active)
             (format "Clocked task: %d minutes - %s"
                     (org-clock-get-clocked-time) (substring-no-properties org-clock-heading)
                     "No Active task")))
        ((equal :pomodoro org-pomodoro-state)
         (format "%d - Pomodoro: %d minutes - %s"
                 org-pomodoro-count (/ (org-pomodoro-remaining-seconds) 60) (substring-no-properties org-clock-heading)))
        ((equal :short-break org-pomodoro-state) "Short Break")
        ((equal :long-break org-pomodoro-state)  "Long Break")))
  1. call this function via emacs-client from terminal
emacsclient -e '(my/org-pomodoro-text-time)'

Result should show expected value depending on your current org-pomodoro state.

  1. (optional) remove double quotes with sed
sed -e 's/^"//' -e 's/"$//' <<<"$(emacsclient -e '(my/org-pomodoro-text-time)')" 
  1. Put final command into your panel