Automatically collect and visualize usage statistics in Ubuntu/OSX environments.
How productive were you today? How much code have you written? Where did your time go?
Keep track of your computer activity throughout the day: visualize your active window titles and the number of keystrokes in beautiful HTML timelines. Current features:
The project currently only works on Ubuntu and OSX, and uses new fancy Promises feature of ECMAScript 6. This might not be implemented in all browsers. My Chrome has it, but for example my Firefox doesn't.
See a blog post (along with multiple screenshots) describing the project here.
To start recording
$ git clone https://github.com/karpathy/ulogme.git
$ sudo apt-get install xdotool wmctrl
. On Fedora, you may also need sudo yum install gnome-screensaver
.cd
inside and run $ ./ulogme.sh
(note: this will ask you for sudo authentication which is required for showkey
command). This will launch two scripts. One records the frequency of keystrokes and the other records active window titles. Both write their logs into log files in the logs/
directory. Every log file is very simply just the unix time stamp followed by data, one per line.The user interface
$ cp render/render_settings_example.js render/render_settings.js
to create your own render_settings.js
settings file. In this file modify everything to your own preferences. Follow the provided example to specify title mappings: A raw window title comes in, and we match it against regular expressions to determine what type of activity it is. For example, the code would convert "Google Chrome - some cool website" into just "Google Chrome". Follow the provided example and read the comments for all settings in the file.$ python ulogme_serve.py
, and go to to the provided address) for example http://localhost:8123
) in your browser. Hit the refresh button on top right every time you'd like to refresh the results based on most recently recorded activitypython export_events.py
and then hit refresh. This should only be an issue the very first time you run ulogme.The user interface can switch between a single day view and an overview view by link on top. You have to hit the refresh button every time you'd like to pull in new data.
/logs
was, instead of looking as {timestamp} {data}
looked as @@@@@@@{timestamp} {data}
, in other words an odd character was appended to the timestamp somehow. We manually erased these characters from the log file to fix the issue.$ python legacy_split_events.py
to convert your events files, once.python ulogme_serve.py
. Sometimes the system can get confused and takes a while to update what ports are being used. Use the optional argument to specify a different port, for example python ulogme_serve.py 8124
and then go to http://localhost:8124
instead, for example.The Ubuntu and OSX code base are a little separate on the data collection side. However, they each just record very simple log files in /logs
. Once the log files are written, export_events.py
takes the log files, does some simple processing and writes the results into .json
files in /render
. The Javascript/HTML/CSS UI codebase is all common and all lives in /render
.
ulogme has three main parts:
keyfreq.sh
and logactivewin.sh
. You probably won't touch these.ulogme_serve.py
which wraps Python's SimpleHTTPServer
and does some basic communication with the UI. For example, the UI can ask the server to write a note to a log file, or for a refresh..json
files in /render
and creating the visualizations. There are several common .js
files, and crucially the index.html
and overview.html
files. I expect that most people might be able to contribute here to add features/cleanup/bugfix.Things get a little ugly in OSX if you want to change anything with recording the log files because you have to recompile these portions any time you make any changes. It's ugly and it had to be done. However, if you're only interested in hacking with the UI, just change Javascript in render
and no recompile is necessary, naturally.
For more projects, this question on Personal Productivity Stack Exchange might be also worth a look.
MIT