Track how you spend your time on your devices.
Cross-platform, extensible, privacy-focused.
Download it: activitywatch.net
Get the source: github.com/ActivityWatch
Slides available at activitywatch.net/slides
Every solution we've seen has at least 2 of these issues.
{
"timestamp": "2017-05-10T10:26:52Z", # ISO8601 format.
"duration": 128.12, # In seconds.
"data": { # Any JSON object,
"app": "google-chrome", # depends on eventtype.
"title": "ErikBjare on GitHub"
}
}
We want to be able to write a simple watcher in as few lines of code as possible. So how do we make watchers easy to write?
Heartbeats to the rescue!
e1 = Event(timestamp="...10:26:52", duration=10, ...)
e2 = Event(timestamp="...10:27:12", duration=0, ...)
def merge(e1, e2, pulsetime=10):
# e1 is the last recorded event
# e2 is a heartbeat
if(e1.timestamp + e1.duration + pulsetime <= e2.timestamp \
and e1.data == e2.data):
# e2 had identical data and was within pulsetime window
return [Event(timestamp=e1.timestamp,
duration=e2.timestamp - e1.timestamp,
data=e1.data)]
else:
return [e1, e2]
Here are a few short clients that do meaningful stuff:
Download it at activitywatch.net