Review of a cli for traking user activity

Hi, Rustaceans!

I'm semi-new to rust and decided to write something both I and others can use. This led me to create Whatawhat - a cli/daemon for automatically traking user activity through the day.

The main goal of the project is to be able to know what you've been working on this afternoon, yesterday, last week. I'm very bad at doing these things myself so I figured this will be a great way to fix that.

No runtime required. No python, no node. The application is a single executable that takes up 1MB during execution.

Cli friendly. Very easy to use with tools like grep and less.

Everything is local. You control your data. your data does not leave your computer, not used by advertisers, not leaked by corporations.

Here's an example of output for this week:


There are also much better examples on the github page. [GitHub - Anoromi/whatawhat: A tool for monitoring user activity on the computer throughout the day.]

This is my first decent Rust project and I wanted to get some feedback on code for my 1.0 version. I want to improve in Rust, so anything is welcome.

3 Likes

Hello @Anoromi,

I was also interested in user tracking, which in my case is to determine what type of activity I do at present, then to drive automation. For example, when I open VSCode in my employer's directory, the system will mark me as working: check me in to work, setup home environment, hide not-at-work app, etc. When I open in my freelancing or side project, it will mark for it. When I open an entertainment site it will mark me as taking a break.

I do thinking about multi-device monitoring (phone, laptop, home sensor, etc), but the foundation is a program that able to collect cues on the system (process running, mouse activity, opened files, network access point, etc). As user, we provide some high-level activity definitions, e.g. on what actually is "Watching YouTube" (Open browser, req youtube.com DNS, mouse rarely active, etc). The program is then able to deduce and log the activity just like your current concept.

I guess I didn't get that you need "code review" before I discovered that your code lies on non-defaunt branch. I'm sorry.

In my case the primary reason for creating the application is to collect statics about myself. I struggle with this and sometimes even wonder what I've spent my afternoon on.