3 ms·
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 intera
by hollerith 5y ago
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).
- rodeph 5y agoSounds handy. Are you interested in sharing the source?
- hollerith 5y agohttps://github.com/hruvulum/hruvulum.github.io/blob/master/idleness.el https://github.com/hruvulum/hruvulum.github.io/blob/master/i... (Is there a more graceful way to publish a single file?)
- Asdrubalini 5y agoGitHub Gist is exactly made for this! https://gist.github.com/ https://gist.github.com/
- natrys 5y agoYou 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/ https://arbtt.nomeata.de/