Score:0

Is there a way to get a log of *active* computer-use?

pr flag

I would like to log the amount of time I spend in front of the computer - so not uptime for the PC, but the amount of time where I'm actively using input (mouse/keyboard).

The worktimer workrave does something like that - you can set an interval and after that, it will display a break-timer. But if you don't use the mouse/keyboard for perhaps 30 secs, the timer is suspended. So it can be done.

The best I could find was procinfo, but does not seem like it. From the man page:

user:  The amount of time spent  running jobs in user space.

nice:  The  amount of time spent running niced jobs in user space.

system: The amount of time spent  running in  kernel space.  Note: the
time spent servicing interrupts is not counted  by the kernel (and
noth‐ ing that procinfo  can  do  about it).

idle:  The  amount  of  time spent doing nothing.

uptime: The time that the system has been up. The above four should
more or less add up to this one.

So "idle time" might be it, but it seems to be idle-time in terms of cpu-usage and not idle in the terms I need it.

I'm on a Lubuntu 20.04 machine.

francois P avatar
it flag
I think you just cannot do that "natively", I think you have to build/write a monitor-like script that measure time you run applications in userland (from a list) & measures additions of all times (sessions) you did work/play with the machine. Another approach is to use a camera that measure (instead of saving film) the time it detects you (from face identification) on the chair on front of the machine.
emilBeBri avatar
pr flag
What do you mean by natively? I'm sure what you mean by that. Workrave does it.
francois P avatar
it flag
I mean from standard shell commands
emilBeBri avatar
pr flag
hmm. seems like you're right, judging from the responses. I'm surprised no one has developed something like this (or perhaps I just don't know how to define the right search terms
francois P avatar
it flag
I'm not so suprised as far as I don"t guess in which use-cases it can be both usefull and legal all the same. It relative to human-survey so ....
Organic Marble avatar
us flag
You might be able to build on this. The accepted answer works great for determining how long it has been since the mouse or keyboard was used. https://askubuntu.com/q/1368345/243321
emilBeBri avatar
pr flag
Nice, thank you
Score:0
pr flag

Workrave keeps a folder in your home dir .workrave, where there are detailed stats about your use of the computer, saved in plaintext. these can be loaded into for example R or Python to do analysis of time spent in front of the computer.

two ressources to get you going: https://github.com/oysteinbf/workrave-stats/ https://medium.com/@ianmooreisme/getting-work-done-with-workrave-b80c4337aa79

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.