News for hackers. Stuff that matters.
Re:Ask HN: What's the weirdest/best thing you've done with E... by hollerith on Wednesday July 07, 2021 @04:18PM (#27765330)
I use an Emacs construct called an idle timer to maintain a file of (the start and end of) every interval 7 minutes long or longer during which I did not interact with Emacs, which enables me to figure out when I started or stopped some activity.

A typical use of the file is figuring out retroactively when I got out of bed even though I didn't make any record of the event at the time the event happened: specifically, I look in the file, see a interval of emacs-idleness 7 hours long, which information I combine with my memory that I used Emacs within minutes of getting out of bed.

The file would be even more useful if it pertained to all my interactions with the OS, not just interactions with Emacs, but that would prove much harder to implement particularly because I would need to implement anew every time I switch OSes. (I was using a different OS when I wrote the Emacs code described above than I am using now.)

The code has provided me much value relative to its implementation cost (time spent).

Re:Ask HN: What's the weirdest/best thing you've done with E... by natrys on Friday July 09, 2021 @01:47AM (#27780790)
You might be interested in a generic time tracking daemon like arbtt[1]. It takes a snapshot of your activities across all programs in much more granular and configurable interval. It stores the data in binary format which is more space efficient but ships with tools that can spit out data for further scripting.

Independent of data collection, arbtt also has a DSL that lets you tag your samples programmatically. Which means you can use logic such as conditionals and regex on data such as active program name, window title etc to mark a sample productive or distracted etc.

The weird thing I do with Emacs here is run a function every N minutes and figure out productive work ratio in that interval with help of other scripts. Then it compares the ratio to a target threshold and performs actions based on if it meets the goal or not. Usually I warn myself if I am not being productive, but when I am feeling particularly intolerant of procrastination I lock myself out of my own laptop for a few minutes, to clear up my head.

[1] https://arbtt.nomeata.de/

Re:Ask HN: What's the weirdest/best thing you've done with E... by rodeph on Thursday July 08, 2021 @11:57PM (#27780332)
Sounds handy. Are you interested in sharing the source?
Re:Ask HN: What's the weirdest/best thing you've done with E... by hollerith on Friday July 09, 2021 @05:14PM (#27788596)
https://github.com/hruvulum/hruvulum.github.io/blob/master/i...

(Is there a more graceful way to publish a single file?)

Re:Ask HN: What's the weirdest/best thing you've done with E... by Asdrubalini on Saturday July 10, 2021 @07:57AM (#27792765)
GitHub Gist is exactly made for this!

https://gist.github.com/