Time Tracking is one stuff that I try to do all the time. There are many good time trackers but when it comes to Linux, Project Hamster wins hands down. I have been using it from end of 2008 and can say it very confidently.
Time Tracking is very important for many purposes and has lot of unexpected perks – For eg it allows me to say what I was doing at Monday 2 PM two weeks ago. More interestingly, it allows me to observe how I spend my time on – both at the macro and micro level.
I have observed that if you do not use time trackers , the amount of time that you "thought" you spent on a task and the "real" time spent diverges quite widely. At least to me, one of the most useful side effect of using time trackers is that I can estimate tasks at much more accurate fashion ! Project Hamster is also one of the inspirations for Chrome Nanny which I have detailed here.
Installation
If you are in Linux and GNOME , it is easy to install it. This is included by default in the recent version of GNOME Desktop. The easiest way to install in Ubuntu is using Synaptic. The package name is hamster-applet . If you select it, all the dependencies will be installed automatically. If you want to use command line then ,
sudo apt-get install hamster-applet
If you are in other Linux distributions, I am sure the instructions are similar (eg using Yum). In the worst case, you can install it from source. For more instructions see Hamster’s installation page .
Setting Up Hamster
Right click on one of the panels (top or bottom) and select "Add To Panel" . Search for Hamster applet and click on "Add" button. Congrats ! Hamster has been added to your panel. Initially it will say "No Activity". If you do not see Hamster, then try logging out and logging in again.
The first step is to set up Hamster . Right click on the applet and select "Preferences" . You will see Hamster’s preference dialog. The first tab is the “General” tab. I usually check both options – Stop tracking on Shutdown and when computer becomes idle. I also have set it to remind me every 10 minutes of my current activity – It will also remind me when there is no activity is set – This will act as a good remainder to always have some activity running
I also have set the new day to start at 00:01. If you are a night owl than me , you can set it later.
The second tab "Categories and Tags" is the most important one. You can add as many categories you want and within each category , any number of activities. For eg some of my categories looks like this : Work, Courses , Sleep , Geek , Entertainment, Friends , Blog etc . Within each category , create appropriate activities – Eg Blog has two activities – Blogging Preparation and (actual) Blogging. Or for eg in Geek, I have reading blogs, doing hacking etc as options. I guess that should give you some basic idea – Of course , you can modify this stuff any time you want.
Tags are another neat idea – This allows you to annotate the activity with one or more tags – I do not use this feature much as my set of activities and categories are fairly comprehensive for my schedule .
Similarly I do not use Hamster’s "Workspaces" tab features, although the idea looks cool !
Reports
Once you use Hamster for quite a while , its time to use the data that you stored. Hamster gives multiple ways to consume the data. The easiest is of course the "Overview" dialog. Right click on the hamster applet and select "Overview". This will open a new dialog which shows the current weeks data. If you interested in aggregate data then you can use the "Totals" tab. Although by default it shows the current week , you can see the current month’s data or even data of a certain date range. To do that , use the drop down at the dialog’s toolbar.
Admittedly, the aggregate data is fairly bland and the visualization is useful but may not meet everyone’s needs. Hamster allows you to export your stats in multiple formats – as html, xml, csv and ical. To do that click on the "Save Report" icon and select "Save As" file type. You can export the csv file to OpenOffice or Excel and do charting to your taste.
Advanced Stuff and Tips
1. Hamster stores its contents in a SQLite3 database. If you are using the latest version of Hamster (atleast 2.30) then the file is at ~/.local/share/hamster-applet/hamster.db . Else look at ~/.gnome2/hamster-applet/hamster.db .
2. Hamster also has a neat feature where you can enter the complete detail about an activity without using other input fields. The canonical format is Activity@Category,description . Combined with the fact that Hamster also has some auto-complete, entering activity is very simple.
3. Use the multiple export report target feature – Previously , I used to write Python code to get data out of the SQLite database. Now you can export as csv and let Excel do the charting . If you are a good programmer check out this post for programmatic access to Hamster data.
4. Hamster has a rudimentary support for keyboard shortcuts – Make use of it ! For eg using super+H to invoke Hamster.
5. Use the comment field liberally – For eg I use it to store the lecture title I watch, blog post I write , movie I watch or even friend whom I am calling. This gives a much detailed information about what happened.
6. Make Hamster whine when you do not use it. It has a feature which will show a message when no activity is set. It is very useful to remind me to track something. I usually set it to 10 minutes.
7. Track as much as you can. There is never too much tracking. I am able to usually track up to 20-22 hours every day and doing it since Fall 2008 . The amount of insight it can give is really mind blowing – Of course a little data mining does help
.
Other Resources
1. Project Hamster’s homepage .
2. Screenshots of using Hamster.
Overall Project Hamster is a really great tool and hope more people discover the joy of time tracking after this post
If you liked this post , please subscribe to the RSS feed.
good article!
Thanks Suresh !
Excellent post and tool… after I started using it, I’m thinking it could be automated. Say, for example, you associate running programs with what you are doing. So if the active program is your e-mail client, then it automatically sets to ‘e-mail’, or if it’s OpenOffice, it automatically changes to ‘work’ or prompts, What kind of work are you doing? That’s my feature request!
Zach,
I agree – such a tool will be cool ! Looks like a lot of people also has asked for it and the author suggested a GNOME tool called timeline although I have not checked it out.
I also wanted a similar tool that will find the focussed window every minute. So I wrote a cron job which invokes a python script. The heart of the script is this function :
def getActiveAppName():
exec_cmd = “”"xprop -id $(xprop -root |awk ‘/_NET_ACTIVE_WINDOW/ {print $5; exit;}’) |awk -F = ‘/WM_CLASS/ {print $2; exit;}’| awk ‘{print $2}’ | sed ‘s/^”//g’ | sed ‘s/”$//g’”"”
runner = subprocess.Popen(exec_cmd, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
runner_res = runner.communicate()[0][:-1]
if not runner_res.isalnum():
exec_cmd = “”"xprop -id $(xprop -root |awk ‘/_NET_ACTIVE_WINDOW/ {print $5; exit;}’) |awk -F = ‘/^WM_NAME/ {print $2; exit;}’ | sed -e’s/^ *”//g’ | sed -e’s/\”$//g’”"”
runner = subprocess.Popen(exec_cmd, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
runner_res = runner.communicate()[0][:-1]
return runner_res
This gets the name of the focussed application – and you can do whatever analysis you can do.
Hope you find it useful !
Okay, that script just amazes me! What a great way to parse what you need. I’ve done similar (although no where near as complicated) pull of data from iwlist and gpsbabel in my wardriver project. (‘garmin wardriver’ on sourceforge.net).
I’ll post my idea on my blog and link back to your great article. I haven’t been able to look deep in the project yet but it seems like there should be a good way to add this feature.
Zack
Zach,
This feature was something that I had wanted to write but never found time ! I will be graduating in a couple of months so I should have more time to play around and implement the feature. Lets see how it goes !
[...] what do I think should happen? Well, I’ve commented on the post that I found this program that I would like it to be automated. Take a ‘picture’ [...]
[...] are two applications by which I get most of work done. I have already talked about Hamster at Time Tracking in Linux using Hamster . In this post, I will talk about Sunbird and [...]
[...] I use a collection of tools to keep myself organized . I have talked about two of them already : Hamster for Time Tracking and Sunbird for reminders . Task Coach is the third tool I frequently [...]
ktimetracker tracks time per each app you run on your X session. It works great.
rtra,
It looks interesting . will take a look.
[...] is one of my favorite apps in Linux. I use it so much that I had previously written a post on it at Time Tracking in Linux using Hamster. One of the problems, I faced when I installed Natty was that it does away with the notification [...]
Question: I was working with Hamster. I copied the db file, and moved it to another install of Hamster in another install of Ubuntu. The new Hamster shows all of my old data, but will not let me log new info. I cannot add an earlier activity or start a new one. Any ideas? Thanks!
http://projecthamster.wordpress.com/trouble-shooting/
Fixed my Hamster. I just ran the initial trouble shooting commands (the first two) and then recopied over my db and life is good.
Seth,
Glad you were able to fix it !