You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~work-timer~ has in mind users who need to regulate how often they work and take breaks. The most common cases would be having large amounts of self-directed work time, either from regularly having a capacity as a student or have flexible work schedules.
5
+
* What is this and why
6
6
7
-
My personal use case is thus. I am currently a university student. I have been using ~work-timer~ for a few months now, and it has been a tremendous help for me as an automatic means for telling me how long I should work and how long I should take a break—important for staying productive on the days I'm tired and not overworking myself on other days.
7
+
Work-timer has in mind users who seek to /regulate/ the duration and frequency in which they work and take breaks from their work. Those who have have large amounts of self-directed work time, for instance students and industrious employees, will appreciate this package the most. Work-timer is meant to be an automatic and therefore zero-effort way to apportion how long you should be taking a break given how long you worked (or: how long you should work given how long you want to take a break).
8
+
9
+
In addition to setting the duration of timers in a way desirable to the user, work-timer supports setting durations of timers but going beyond them, modifying the parameters of the current timer, pausing timers, and dynamically prompting for additions or subtractions to timer durations based on deviations in the duration and elapsed time of the durations of previous timers. (i.e. surplus time). (See [[*Concepts][Concepts]] for an explanation of relevant concepts.)
8
10
9
11
* Usage
10
12
11
-
** Advantage: history
13
+
** Workflow
12
14
13
-
#+begin_comment
14
-
Include annotated image (numbered elements, like a instructional diagram) that shows example data for ~work-timer-history~.
15
-
#+end_comment
15
+
Users are meant to start a working timer either with ~work-timer-start~ or ~work-timer-dwim~. If during the timer the user wishes to modify the parameters of the timer, they can call ~work-timer-modify~. When they wish, they can call ~work-timer-cycle-finish~ or ~work-timer-dwim~ to end the current timer and start a break timer. Then once they wish, they can once again call ~work-timer-cycle-finish~ or ~work-timer-dwim~ to end that timer and begin a new working timer.
16
16
17
-
* Mimicking ~org-pomodoro~
17
+
The durations of all timers are automatically determined according to ~work-timer-work-duration-function~ and ~work-timer-break-duration-function~.
18
18
19
-
#+begin_comment
20
-
Include an example set up for the 50-minute variant
21
-
#+end_comment
19
+
** Concepts
22
20
23
-
* Mimicking ~org-pomodoro-third-time~
21
+
*Running or elapsed time:* Every timer has a running time, that is, the time since the timer began. (Using ~work-timer-modify~, the running time of a timer can be modified.) This is effectively a stopwatch.
24
22
25
-
#+begin_comment
26
-
Include example set ups for different fractional break times?
27
-
#+end_comment
23
+
+ "Durations" :: Throughout this README, timers are said to have durations which is determined once the timer is started. (Using ~work-timer-modify~, the duration of a timer can be modified.) A sound (~work-timer-sound~) will play once the running time of the timer meets that duration. However, timers will continue to run beyond their duration indefinitely. This allows users the flexibility to go over or under the duration initially set by the timer (and take into account this overrun duration in ~work-timer-work-duration-function~ and ~work-timer-break-duration-function~ if they are configured to do so). In total, "durations" should be thought of more as targets rather than end-points.
24
+
+ Overrun time :: The "overrun" time of a timer is the amount of time a user has spent passed the duration of the timer. It is the difference between the running time and duration. Overrun time can be usefully incorporated into ~work-timer-work-duration-function~ or ~work-timer-break-duration-function~.
25
+
+ Working and break timers :: Work-timer has "working" timers and "break" timers.[fn:1] These are essentially timers labeled as such to help determine the parameters of following timers. For instance, a user may want their break timer durations to be determined separately from their work timer durations.
26
+
+ Timer history :: The parameters of every timer (e.g. type, duration, running time, and pauses) are stored in ~work-timer-history~. In this way, ~work-timer-work-duration-function~ or ~work-timer-break-duration-function~ can leverage details of previous timer(s) to determine the duration for the next timer. The history is cleared when ~work-timer-end~ is called.
27
+
+ Surplus or "carry over" time :: Surplus time is the amount of time added to a timer based on the amount of overrun time of /previous timer(s) of the same type/.
28
28
29
-
* Advanced configuration
29
+
For example, if I worked for a period, then took a break 4 minutes shorter than my duration, the next break timer I have will ask if I want to add 4 minutes to the timer (or another user-inputted time). Likewise, if I took a break for 6 minutes longer than I should've, the next break timer will ask if I want to subtract 6 minutes (or another user-inputted time) from my break. *Effectively, considering surplus time allows the user to "make up" for going over time in breaks or "given themselves a reward" for going above and beyond in work.*
30
30
31
-
** Internals
31
+
Currently, every built-in option for ~work-timer-break-duration-function~ considers surplus time when creating a new timer if ~work-timer-break-surplus-prompt-p~ is non-nil. (The current implementation of built-in break-duration functions will prompt the user for a surplus time before it is added.)
32
32
33
-
#+begin_comment
34
-
Include Mermaid diagram showcasing the interaction between the layers of the program. One end should be the USER, another the MODE LINE TIMER. In between should be the layers of (at the time of writing this): HISTORY, DURATION FUNCTIONS
35
-
#+end_comment
33
+
[fn:1] Work-timer is written such that users can neatly hack the internals of work-timer to add any number of other types of timers.
36
34
37
-
** Relevant variables and functions
35
+
** Notable customizable variables
38
36
39
-
** Example configuration
37
+
+ ~work-timer-debug~: Whether to print useful debugging messages.
38
+
+ ~work-timer-sound~: Sound file played when a timer's running time meets its duration.
39
+
+ ~work-timer-notifications-p~: Whether to send notifications.
40
+
+ ~work-timer-work-duration-function~: Function used to calculate the duration of a new working timer.
41
+
+ ~work-timer-break-duration-function~: Function used to calculate the duration of a new break timer.
42
+
+ ~work-timer-default-*~: Variables relevant to the default/basic style of timers.
43
+
+ ~work-timer-pomodoro-*~: Variables relevant to the [[https://en.wikipedia.org/wiki/Pomodoro_Technique][Pomodoro]] style of timers.
44
+
+ ~work-timer-fractional-*~: Variables relevant to the "fractional" style of timers. (See [[*Org-pomodoro-third-time][Org-pomodoro-third-time]] for a description of the fractional style of timer.)
45
+
+ ~work-timer-break-surplus-prompt-p~: Whether to prompt for a surplus time (see [[*Concepts][Concepts]] for a description of surplus time) when creating a new timer.[fn:2]
40
46
41
-
#+begin_comment
42
-
Include my own configuration?
43
-
#+end_comment
47
+
[fn:2] The prompt is only shown for break/work timer functions that use the ~work-timer--surplus-prompt~ function.
44
48
45
-
** Suggestions
49
+
** Commands
46
50
47
-
#+begin_comment
48
-
Mention that I users can take the built-in break and work duration functions and…
49
-
+ Advise (e.g. override) them.
50
-
+ Create their own functions that wrap an existing function
| ~work-timer-start~ | C-c o w s | Start a "working" timer |
54
+
| ~work-timer-cycle-finish~ | C-c o w f | Start a timer meant to proceed[fn:3] the current timer |
55
+
| ~work-timer-end~ | C-c o w e | End current timer and clear history |
56
+
| ~work-timer-dwim~ | C-c o w w | Either start a timer or cycle to a new timer |
57
+
| ~work-timer-pause-or-continue~ | C-c o w p | Pause or continue the running time of the current timer |
58
+
| ~work-timer-modify~ | C-c o w m | Modify the parameters of the current timer |
59
+
| ~work-timer-report~ | C-c o w r | Print out statistics about ~work-timer-history~ |
53
60
54
-
* Inspirations and related packages
61
+
[fn:3] That is, start a working timer if the current one is a break timer and start a break timer if the current one is a working timer.
55
62
56
-
+ [[https://github.com/telotortium/org-pomodoro-third-time][Org-pomodoro-third-time: Adapt org-pomodoro to implement the Third Time system]]
57
-
(mention differences tk)
58
-
+ Org-timer: built-in org-mode package.
59
-
+ Tmr: Protesilaos's timer package.
63
+
** Integration with org-agenda
60
64
61
-
# LocalWords: Tmr Protesilaos's
65
+
Additionally, ~work-timer-with-org-clock-mode~ is a global minor mode that allows ~work-timer-dwim~ to work in org-agenda buffers. Calling ~work-timer-dwim~ clocks in the todo at point (in org-agenda buffers) while starting a work timer and clocks out the current todo (only in org-agenda buffers) while starting a break timer. (There is additional functionality written such that other behaviors between org-agenda and work-timer work as expected. See ~work-timer-org-clock-in~, ~work-timer-org-clock-out~, and ~work-timer-org-agenda-dwim~.)
62
66
63
-
* Comparison to ~org-pomodoro~
67
+
* Comparison to org-pomodoro
64
68
65
69
** Differences
66
70
@@ -75,15 +79,35 @@ Mention that I users can take the built-in break and work duration functions and
75
79
76
80
** Similarities
77
81
78
-
+ Overrun timers.
79
-
+ Mode line indictor.
82
+
+ Overrun in timers.
83
+
+ Mode line indicator.
80
84
+ Pomodoro-style timers.
85
+
+ ~org-agenda~ integration
86
+
87
+
** Why I use work-timer instead of using org-pomodoro
88
+
89
+
Overall, org-pomodoro comes closest to the behavior I seek. However, I found org-pomodoro lacking in flexibility. Flexibility in which sense? In two senses:
90
+
1. *In-practice.* There are many cases when I hoped org-pomodoro could support me doing one thing while it could not. To name just a few:
91
+
a. /Pausing./ Sometimes I want to pause a timer because, say, I want to go to the bathroom without chipping away at the current work or break timer.
92
+
b. /Flexibility in timer durations./ Sometimes I might be feeling particularly sluggish or particularly productive, and org-pomodoro did not have the flexibility for me to painlessly work or take a break for as long as I have in mind while also maintaining its purpose: off-loading the mental work of keeping such information top-of-mind to Emacs.
93
+
2. *User-side hacking.* org-pomodoro seemed implemented in such a way as to preclude as possibilities the functions are so outlined. Or, at least make it difficult.
94
+
As such, I made work-timer to try to ameliorate these pains.
95
+
96
+
* Mimicking X package
97
+
98
+
** Org-pomodoro
99
+
100
+
Setting ~work-timer-work-duration-function~ to ~work-timer-work-duration-pomodoro~ and ~work-timer-break-duration-function~ to ~work-timer-break-duration-pomodoro~ will mimic a pomodoro-style workflow. Working timers will be 25 minutes long (configurable by ~work-timer-pomodoro-work-duration~; the pomodoro technique Kis usually don in multiples of 25 minutes, the second most common working duration being 50 minutes with 10 minute breaks) and break timers will be 5 minutes long (~work-timer-pomodoro-break-duration-short~) with 20 minute long breaks every 4 working timers (~work-timer-pomodoro-break-duration-long~).
101
+
102
+
** Org-pomodoro-third-time
103
+
104
+
Setting ~work-timer-work-duration-function~ to ~work-timer-work-duration-fractional~ and ~work-timer-break-duration-function~ ~work-timer-break-duration-fractional~ will create a workflow similar to org-third-time's workflow. Work timers will be 25 minutes long (~work-timer-fractional-work-duration~ ) and break timers will be 0.2 times (~work-timer-fractional-break-duration-fraction~) the elapsed working timer (read [[*Concepts][Concepts]] for the difference between "durations" and "elapsed times").
81
105
82
106
* Tips and tricks
83
107
84
108
** Saving current timer across Emacs sessions with ~savehist~
85
109
86
-
Sometimes you have a running timer and Emacs crashes. Or perhaps you'd like to save the ~work-timer-history~ for one reason or another. ~work-timer~ simply saves the current work timer information in variables, so you can save these variables across Emacs sessions via ~savehist~. ~work-timer~ is configured such that starting a new timer (via ~work-timer-start~ or ~work-timer-start-or-finish~) will use the already set variable values, effectively resuming the timer.
110
+
Sometimes you have a running timer and Emacs crashes. Or perhaps you'd like to save the ~work-timer-history~ for one reason or another. work-timer simply saves the current work timer information in variables, so you can save these variables across Emacs sessions via ~savehist~. work-timer is configured such that starting a new timer (via ~work-timer-start~ or ~work-timer-start-or-finish~) will use the already set variable values, effectively resuming the timer.
87
111
#+begin_src emacs-lisp
88
112
;; Save timer variables to resume timer across Emacs sessions
89
113
(dolist (var '(work-timer-start-time
@@ -93,4 +117,11 @@ Sometimes you have a running timer and Emacs crashes. Or perhaps you'd like to s
93
117
work-timer-history))
94
118
(add-to-list 'savehist-additional-variables var))
95
119
#+end_src
96
-
If you do not want to save the timer history, feel free to remove ~work-timer-history~. (It might be useful to know that ~work-timer-end~ allows from wiping the entire history or just the current timer.)
120
+
If you do not want to save the timer history, feel free to remove ~work-timer-history~. (It might be useful to know that ~work-timer-end~ wipes ~work-timer-history~.)
121
+
122
+
* Inspirations and related packages
123
+
124
+
+ [[https://github.com/telotortium/org-pomodoro-third-time][Org-pomodoro-third-time: Adapt org-pomodoro to implement the Third Time system]]
0 commit comments