Thursday, June 7, 2012

Pomodoro

Recently I have been trying to improve my production. During my (quick) search I came up across the Pomodoro Technique, which is a time management method created by Francesco Cirillo in the 80s. Wikipedia explains all about it much better than I will ever do.

Basically you work for 25 minutes (a pomodoro) and after that you get a 5 minutes break, after 4 pomodoros you get a longer break, from 15 to 20 minutes.

Luckily for me there's a module available for my main work tool: Emacs. The module works well except for the fact that it doesn't beep when the pomodoro ends, adding this feature was super easy, even for someone that has never code in lisp before, like myself.

For Emac's beep (visible beep) notifications to work on Awesome WM, the following needs to be added to your .emacs:

(defun urgent-hint ()
  (let ((wm-hints (append (x-window-property "WM_HINTS" nil "WM_HINTS" nil nil t) nil)))
    (setcar wm-hints (logior (car wm-hints) #x00000100))
    (x-change-window-property "WM_HINTS" wm-hints nil "WM_HINTS" 32 t)))

(defun urgent-hint-helper (a b c)
  (urgent-hint))

(setq ring-bell-function 'urgent-hint)


No comments:

Post a Comment