reddit / emacs

[ANN] org-arbeitszeit: Calculate your working hours from your clocked time

bkaestner · 2022-01-27 08:05
bkaestner · 2022-01-27 08:21
# Motivation Org's dynamic block `clocktable` is a wonderful tool. With ease, it provides you a glance at what you've done in a nice tabular view. However, there's one drawback: it forces me to calculate my weekly over- and undertime. At the end of the day, I just want to know whether I already clocked in all my hours of the week (and can go into the weekend with peace of mind), or if I'm actually working too much per week regularly. This is where `org-arbeitszeit` comes in, a new Emacs package that creates tables like this: #+BEGIN: arbeitszeit :tstart "2022-01-03" :tend "2022-01-23" :match "-break" | Week | Hours | +Time | |----------+--------+--------| | 2022-W01 | 41:40 | 01:40 | | 2022-W02 | 39:35 | -00:25 | | 2022-W03 | 38:55 | -01:05 | |----------+--------+--------| | Total: | 120:10 | 00:10 | #+TBLFM: $3=$2-144000;U::@>$2..@>$>=vsum(@I..@II);U #+END: # Features - sum up the clocked hours in the interval `:tstart` and `:tend` - specify weekly working times via `:hours-per-day` and `:days-per-week` (or customize the `org-arbeitszeit-housr-per-day` and `org-arbeitszeit-days-per-week` variables) - only sum up clocks with given tags (or explicitly ignore those `:lunch:break:`s) via `:match`, e.g. `:match "-lunch"` ## Missing Features Currently, there are three additional features I want to add but that don't change the way the table works: - `:scope` to collect the clocked hours from all agenda files or just some files (currently, only the current file is used). I already use a modified version at work, but it has some performance issues that I didn't want to introduce in the initial release. Given that you usually update these blocks only manually, the performance hit may be fine. - `:vacations` and `holidays` to specify days that should not get counted for the time difference. Still working out the semantics. In the meantime, you can add fake clocked working days to your file. I hope that I can add the `:scope` feature this weekend. ## Melpa inclusion This feature package is currently up for inclusion in Melpa and waiting for review, see https://github.com/melpa/melpa/pull/7877. ---- This package has been on my backburner for two weeks, and [Erich's recent article](https://www.erichgrunewald.com/posts/how-i-track-my-hour-balance-with-a-custom-org-mode-clock-table/) ([discussion on reddit](https://old.reddit.com/r/emacs/comments/scmaf6/how_i_track_my_hour_balance_with_a_custom_orgmode/)) finally pushed me to actually complete it.
github-alphapapa · 2022-01-28 21:18
Cool. A couple of suggestions: 1. Of course, if German (I guess) is your native language, this name may seem natural. But despite Org's original author's not having English as his native tongue, Emacs's and Org's native languages are English, and published packages use it as standard. So if you could come up with a descriptive English name, it would help potential users find it. 2. Even better, if appropriate, would be to integrate this functionality into Org itself. If you post a message on the mailing list, I'm sure the developers could guide you as to whether this would be a good idea.
bkaestner · 2022-02-01 19:28
Thanks for the feedback! 1. I originally chose `arbeitszeit` since I didn't want to reserve a proper/better name if I don't manage to finish the package. I might chose another one later. 2. Upstreaming into Org would be a little bit early, but definitely interesting. I'll ask on the mailing list after I finished the `:scope` feature. Thanks for both suggestions!
29nullvier · 2022-02-07 13:35
Awesome, thanks for creating and sharing this! As someone who needs to keep an eye on overtime, and submit working hours once per month, I currently use a standard org spreadsheet with a `TBLFM` for this. While `TBLFM` and the functionality to query a table (in my case a `clocktable`) using the `remote` function is a *very nice and powerful* tool, the formula is increasingly hard to read and not very flexible. In case someone ins interested, the formula used to look like this: #+TBLFM: @4$4..@>$4=remote(mastertimesheet, @@#$3);U::$5=$-1 - $-2;U::@4$6..@>$6=@-1 + $-1;U Thus, I need give `org-arbeitszeit` a try!
bkaestner · 2022-03-16 05:35
Thanks for the feedback! Sorry for getting back late to you, apparently my notifications don't work properly. `org-arbeitszeit` is still [missing more possible scopes](https://github.com/bkaestner/org-arbeitszeit/issues/2). I really need to implement them, since I lost my original variant I use at work...