Home > timetracker

timetracker

Timetracker is a project mainly written in Python, it's free.

Timetracker v0.1

A simple python utility that can be used to track what you're doing on your computer at any moment. It can currrently track your activities based on rules that you have defined in your configuration file and uses the hamster time tracker tool to track your activity along with the description and tags associated with each activity.

Sometimes you may leave your desk to take care of something such as helping a colleague or attending a meeting and don't want timetracker to track the inactivity of your machine. In this situation you can manually set your activity with the hamster-applet to whatever activity name you'd like and make sure to include the tag #ttstop to make sure that timetracker won't update your tracker until you've stopped this activity yourself. This means that even if your desktop becomes inactive the tracker that is currently in use will continue to track that same manually inserted activity.

Requirements

  • Python 2.6+

    On Ubuntu: apt-get install python2.6 python-configobj

  • hamster-applet latest build from master branch at

    http://projecthamster.wordpress.com/building-and-running/

    Installing hamster:

    1. git clone git://git.gnome.org/hamster-applet
    2. cd hamster-applet
    3. ./waf configure build --prefix=/usr
    4. sudo ./waf install

Supported Environments

Currently both KDE and Gnome desktops are supported but the tracking tool is the same hamster time tracking application. On Gnome you can add the hamster-applet to one of your panels but on KDE you'll have to startup the application "/usr/lib/hamster-applet/hamster-applet -w" background and then you can put that window on your desktop and remove the borders and putting it in one of the desktop corners so you can check on it. You don't need to have the applet running for the timetracker to work correctly because it will still record all of your activites to the hamster-service and you can check your statistics by issuing "hamster-time-tracker" on the command line.

Installation

  1. ./waf configure
  2. ./waf build
  3. sudo ./waf install

You'll now have timetracker installed correctly on your system and you should be able to execute the command "timetracker" on your command line.

Execution

After checking out the tool it can easily be executed directly from the src directory. Before you execute you should copy the template configuration file from timetracker.conf.template to ~/.timetracker.conf. Then you can execute and daemonize the timetracker utility by simply executing:

timetracker.py -d

A simple way to make sure your timertracker utility never stops running is to use the ps-watcher application to monitor and make sure it is always running. More information on the ps-watcher application can be found here:

  • http://ps-watcher.sourceforge.net/

A sample configuration entry for the timetracker application would be:

[timetracker] occurs = none action = timetracker.py -d

Configuration

The configuration file for the timetracker utility is located at ~/.timetracker.conf and has a few different options that you can set. The first section is the "main" section which houses the configuration settings for the currently used tracker and update interval. It also houses the exact location of the output and error logs for timetracker.

The "tags" section is where you can associate keywords with the tags that should be recorded for that keyword. When you specify a keyword that word is compared in lowercase to the window title in lowercase.

The "activities" section also matches keywords in lower case but in this case its just choosing which activity name to associate with the currently focused window.

The main reason to compare keywords in lowercase is that its fast and cheap. We can easily support regular expressions in the future but for now this approach works fine.

Previous:tec-del-habla