-
Notifications
You must be signed in to change notification settings - Fork 79
Home
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
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.
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
- running emacs-server
- system panel which can display output of shell command (extensions for Plasma DE or GNOME Shell )
- 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")))
- 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.
- (optional) remove double quotes with
sed
sed -e 's/^"//' -e 's/"$//' <<<"$(emacsclient -e '(my/org-pomodoro-text-time)')"
- Put final command into your panel