https://activitywatch.net/ gets you part of the way there.

I already use it. It's quite good but more for time tracking!