GNOME Activity Journal and Zeitgeist are some of the fascinating recent projects in Linux. I have been a user from their initial versions and have been intending to write a tutorial on it. Two reasons I kept postponing it : GNOME Activity Journal kept changing very frequently and writing a comprehensive Zeitgeist tutorial will take too much time given its potential ! So I decided to split my tutorial into two parts : A basic tutorial on GNOME Activity Journal, Zeitgeist and Sezen and a more geeky post on Zeitgeist in the near future.
[Update Jun 24 2011] : Updated information about Activity Log Manager and data providers.
Why are Zeitgeist and GNOME Activity Journal so cool ?
I will make an assumption here that the reader is a relatively active user of Linux. Everyone knows Linux is cool, secure and blah blah but it is still does not have enough traction in Desktop. Sure Linux dominates in servers and embedded systems but Desktop is where the mind share is. I will not say that Linux Desktop is hard to use but we have not provided compelling reasons for people to try it out. Recently, there has been some effort to make Desktop more user friendly, especially from Ubuntu and Fedora – Let the force be with them :)
If you have been following GNOME, you would have heard the term "Document Centric GNOME" thrown around often. If you want, take a look at this insightful (though sort of outdated) GUADEC presentation that started it all.
One of the important problems in Desktop is finding the files you used to perform some task – This is not necessarily the files you used today morning or yesterday. If that is the case, you can always take a look at recently used documents. Let us take few examples :
1. Where are the set of pdf files I used to learn Gaussian Processes last week ?
2. When I was fixing an issue in Chrome Nanny last month what were the files I kept opened in Vim ?
3. I want to buy the book I checked out in Amazon last week. What is its url ? It must be in my web history – But wait was it in Chrome or Firefox?
4. How many excel sheets did I look at last week ? Where are they all located ?
5. Last friday, I listened to some awesome songs in Rhythmbox and I want to listen the same set of songs again. How do I find out all the songs that played then ?
6. More generally, I performed task1 under some context – which involves set of files, websites and other stuff. Note that it is application independent and might involve multiple applications. It must be possible to get into that context anytime I want effortlessly.
These are some of the common scenarios that occurs to us. But no OS has so far provided any convenient way to solve them. Of course, the usual answer is to organize your folders properly or keep a note of things you did. These are not solutions at all. If I organize them properly then each file will be nested deeply and remembering the organization becomes a pain. The folder paradigm is useful but not very intuitive or convenient for users. Remember that for a lot of people (ignoring techies), using Computer is usually a means to get some job done. They are not obsessively focused on organizing the computer. They have a job to complete and we must make it as simple as possible for them to complete it.
Just think how it is done in the real world. You always have an option of filing all the necessary items into a locker so that you can find it later. It must be possible to do the same in a computer : create a task context, view previous activities etc. Zeitgeist and GNOME Activity Journal are some of the tools that will help you in that quest. For some more exotic scenarios , check out the usecases in Zeitgeist vision document. Very few of the usecases can be realized immediately through them but the underlying framework is robust enough to support all of them and more ! GNOME 3.0 has some grand ideas on transforming the Desktop as we know. IMHO, Zeitgeist , GNOME Activity Journal , GNOME Shell are going to make using Linux really cool.
High Level Overview of Zeitgeist , GNOME Activity Journal and Sezen
Zeitgeist is a tricky thing to nail – You can consider it as a daemon that stores all the relevant "events" in your computer. Events can be as simple as user opening a file or browsing to a site or something more complex. Zeitgeist silently stores all the events in its db. The information stored can be arbitrary – it can be as simple as filename or as complex as the entire file content and metadata. Some of the possible metadata include tags, geo location etc. Zeitgeist exposes an API that allows other data "providers" to save and query events. It is the underlying framework over which other cool tools can be written using its API or extended using plugins. Informally, Zeitgeist shuns the folder paradigm and embraces a timeline/task based paradigm. This is a powerful idea as it provides you an additional dimensions (time, context) to browse the files , in addition to folder structure.
GNOME Activity Journal is an "activity browser". It allows you to view in a timeline all the activities you did in the past. Note the emphasis on activity. Potentially an activity can be any interaction with some resource. The activity can be as simple as viewing a file or chatting with a contact. In the future, activity can be as complex as you want. The journal will allow you to search for past activities, filter activities based on source , annotate the activities and so on. Timeline is not the only way to view the files/activities. You can find them by mode of use or even tags that are manually annotated. Infact, it even has a cool feature where it "infers" related files based on usage patterns.
Sezen is a neat applet that allows you to search for activities/files in a convenient way. The search in Zeitgeist sort of sucks now and I use Sezen to fill the void. I hope that the journal will have a more powerful and convenient search mechanism.
Hopefully your interest is now piqued. You can always install Zeitgeist and GNOME Activity Journal from the Ubuntu repository , but it is usually stale. If you are ok with it use the following instructions to install it.
sudo apt-get install zeitgeist gnome-activity-journal
If you want to enjoy the latest features without waiting for a new version of Ubuntu, then add the zeitgeist ppa to the list of repositories. The steps are :
sudo add-apt-repository ppa:zeitgeist/ppa
sudo apt-get update
sudo apt-get install zeitgeist gnome-activity-journal
Some time ago there was a bug where due to some issue in Zeitgeist, GNOME Activity Journal will not start. If I am right, the reason was that when Zeitgeist was updated, the daemon was still running with the old version . If you are bitten by that bug, either restart the system. Alternatively, run this command :
zeitgeist-daemon –replace &
Sezen is a utility that allows you to view the recently used files in a convenient fashion. Some of the functionalities of Sezen overlaps with that of GNOME Activity Journal. When the journal’s search becomes more useful, Sezen may not be needed. Assuming you have installed the PPA, you can install Sezen by
sudo apt-get install sezen
GNOME Activity Journal
GNOME Activity Journal is an "activity browser". It helps you to browse your recently used files, websites or contacts. The information is presented in a chronological fashion. It integrates tightly with Zeitgeist and tracker . As one of the website put it , it is a "viewport to the past". You can access it from Applications > Accessories > Activity Journal.
The journal has three different views – multi view, thumb view and timeline view. The default is the multi view which allows you to see the details of 3 days at a time. So your screen will look something like this :
You can immediately notice some things : Information about the last three days are displayed. If you have used in extensively, then information is categorized into files accessed in morning, afternoon and evening. This means that it is now easier to view the files you accessed on morning of 16th of last month. What is more : the journal also classifies files based their type. So you can see that there are atleast 3 different types of file type : You have sections like "Edited or Read documents", "Worked with Images" and "Conversation with contact". As you have different types of data providers, you can view them in a more granular way. Examples include audio,video and websites. Hovering over one of the items will show the preview of that item. So you can immediately take a peek at the item’s content. Of course, you can always click on the item and it will open up in the appropriate application.
You can also see the arrow buttons on the either side of the screen that allows you to navigate across the timeline. If you take a look at the bottom panel, there is a bar chart which depicts the user activity. You can go to any past time by clicking on the appropriate bar. For eg, you can click on somewhere in the middle of bottom panel for August to look at the journal for that time period. If the date you want to check is long back, then click on the left edge of the bottom panel and it will take you back in time in a faster scale. Once you reached the month and approximate date, you can use the right/left arrows to go to the exact timeline. The bars highlighted in orange indicate the dates that are shown in the multiview.
So if you want to know which images you checked out on say Oct 1 2010, all you need to do is to go to that date – either using bottom panel or the navigation arrows. Now expand the itemset "Worked with images" and you will find all the images you viewed on that day. You can always click on the arrow icon on the toolbar to get the current day’s details.
Thumb view is another commonly used view. This is especially useful if you viewed lot of images or videos. You can notice that thumb view is available for only single day. You can still the arrows or the bottom panel to navigate to other days.
This is my favorite view as it packs lot of information in a concise fashion. All the items are show one by one and near each item there is a blue square to indicate the time it was accessed. For eg you can infer that I accessed gBlogStats.ods somewhere around 11 AM on Oct 9 twice. Similarly, I accessed the file gblognotes.txt intermittently starting from early morning 1 AM till around 8 PM. Each of the blue squares indicate one access. It can either viewing the file or saving it. Using this you can answer the question how many time did I access a file or go to a website. Very neat !
Some times you may think that few of the items are important and want to highlight them separately. In GNOME Activity Journal , it is done via pinning the item. So, right click and item and select "Add Pin". This item will be now highlighted at the top separately. You can again right click on the item and select "Remove Pin" to bring it back to original status. Alternatively, you can click on the pin icon of a pinned item to unpin it. You can notice that pinning applies only to Multi View. Also pinned items show up in the slot for "Today". This kinda make sense as the journal typically opens show today’s details and you have an one click access to it. I hope they soon add a feature where I can highlight few items that is specific to a day.
A image showing a few pinned items and about to add pin to another item is shown below.
There are two major ways to filter items in GNOME Activity Journal. One is the temporal way where you want to see all websites you accessed on Sep 1 2010. If this is the usecase, you can use the naviagation arrows or the bottom panel to go to the appropriate date and see all the files. Another alternate way is to see all the file with "blog" in their names. If this is your usecase, you can use search icon at the toolbar. Clicking it will display a textbox and a dropdown showing the various types of items. So this means that I can filter an item based on partial name and also its "type". As you can see in the screenshot , there are lot of different types of entities ranging from documents , email, notes, chat conversations etc. A screenshot showing a search is shown below :
Note that you can search items only in the multi view. When you enter a query and select the appropriate type, the journal highlights the selected files with a bold blue font. This is where I personally feel GNOME Activity Journal has dropped the ball. When you filter an item, it does not show a new screen which lists the match items in a timeline. Instead it maintains the same multi view and just bolds the filtered file. What is worse is that if I want to find if I had accessed the filtered file last week, I have to manually scroll. In one of the screencasts, it was claimed that when a particular day has a file that matches the filter, it will be highlighted in blue. I am not fully sure it works correctly.
There are multiple ways in which you can improve this page : For eg having separate time line for search results , or atleast highlighting days with matches in blue, using tracker/ fts plugin so that I can search the content, use tracker so that tags work in search etc. I am sure that these minor issues will be fixed soon. Till then you can use Sezen to work around the journal limitations. Look at the section on Sezen for additional details. If you want to do a full text search then use tracker. Please see the section on Tracker for additional details.
Tags And Related Files
Another neat feature of Zeitgeist is allowing you to tag files. I believe this is done using Tracker internally. To add tags to an item, right click it and select "More Information". This will open a new dialog like the one shown below.
You can see that tags for the file can be entered one by one on the textbox. You can also delete any previously added tags. In the same dialog, you will see an interesting feature – "Used With" . If I use the files in a group, then Zeitgeist will recognise it and show it. Of course, it might have some noise, but most of the times it is bang on. For eg, I usually use the file "gblognotes.txt" as a scratch pad where I jot down all my ideas , basic structure etc. "gblogpost.txt" is the file where the actual post is written. The other two ods files were used to track blog related statistics. They have lot of co-occurrence and thats why Zeitgeist recognised them. The last three are essentially noise which might have occurred because I used them concurrently. It should be interesting to see if these items will go off when they do not co-occur frequently.
Another neat feature is that any tags that get added here gets reflected in the file’s tracker property page. For eg, right click on the file for which the tags were added. If you had tracker, then you will see a new tab called "Tags". Browsing it you can see that the added tag is checked. As an example, in the screenshot below, you can see that the file has "blog" tag enabled.
Controlling Zeitgeist logging using Activity Log Manager
Sometimes you feel that the relentless logging of Zeitgeist is a bit too much. There might be three different scenarios .
(1) You want to delete some past event from Zeitgeist log
(2) You want to stop entire Zeitgeist logging for some time.
(2) You want to instruct Zeitgeist to never log certain (types of) files.
The first is easy to perform. Once an item is added to the journal, you can always right click it and say "Delete Item from Journal". This will remove it from the list. There is also an option "Delete all events with this URI". This deletes all the events corresponding to a certain file from the logs. The primary inconvenience with this method is that if you want to delete lot of files, then you have to go about it manually.
When this article was first written, there was no elegant way to control the logging, short of coding it yourself. Recently, the developers released Activity Log Manager that provides a reasonably convenient mechanism to achieve that.
If you are using the Zeitgeist PPA , the software can be installed by
sudo apt-get install activity-log-manager
Once installed, it can be invoked by “activity-log-manager” from the command line. There are multiple use cases that are handled by this tool .
(1) Pause Zeitgeist logging temporarily
Sometimes, you may want to temporarily stop Zeitgeist from logging. For eg, sometimes, I grade students homeworks and do not want them to enter the logs. In scenarios like this, you can stop it by invoking “activity-log-manager” and clicking on the button that looks like a tick. In the screenshot below, it’s the button near “Logging Active”. This will stop the logging till you enable it or restart the computer (or log back in).
(2) Deleting Previous Zeitgeist Events using History tab
If there is some time interval within which you want to delete all events logged by Zeitgeist , you will be using the “History” tab. The log manager conveniently gives two options : One is to delete the events in the past few minutes/hours/days etc. The other is to give explicitly the date range. Most of the time this should do the trick.
There are some slight inconveniences though. If you want to partially delete events then you are stuck with using Activity Journal. For eg, if I want to delete few events from the last 15 minutes but not all then its not possible from here. The second issue is that the more general option for making Zeitgeist forget events only accept dates and not time ranges. For eg, I cannot currently delete events from say Jun 22 1 PM to Jun 23 4 PM . Hopefully this will be fixed in the future. The screenshot is below.
(3) Blacklisting Zeitgeist Events from an Application using “Applications” tab
If you want to prevent events from a specific application from entering Zeitgeist logs, then use the “Applications” tab. This tab allows you to add events from known applications. Clicking on “Add” button shows a dialog with known applications and selecting it prevents events generated from that application from entering the Zeitgeist logs. You can add as many applications as you want.
Currently, this shows only the applications that have .desktop entries. And it is not possible to add custom applications. The list of applications are not sorted. It has a rudimentary prefix match support. For eg, if you want to block Google Chrome typing a prefix like “goog” takes you to it. Typing a non prefix like Chrome does not seem to work. The screenshot shows the tab with the list of applications.
(4) Blacklisting or Preventing Zeitgeist Events from a folder or file types using “Files” tab.
This is the final use case. Sometimes you may not want Zeitgeist to log events from some folder. Or may be you do not want Zeitgeist logging your music events. The “Files” tab allows you to do it.
The files tab is broadly split into two blocks. In the first block, you can block events from certain types of files – Like audios, text files, videos etc. I am not sure if you will ever want to use this broad a blacklist as it negates the use of Zeitgeist , but I am glad the developers provided this option.
The second block allows you to enter a set of folders such that any events under those folders do not cause Zeitgeist events. You can use the dropdown to select either few pre specified folders or use the “Other” options to select an altogether new folder. In the screenshot below, I have selected temp folder to be blacklisted. This is my scratch folder for my programming and do not want them to be logged as they will be anyway deleted soon !
Hopefully, these options satisfy most of the potential use cases. Zeitgeist is a cool idea and once it has the log manager , it is even more cool !
Before we discuss slightly more techie stuff, let me discuss two other tools that work in conjunction with Zeitgeist and GNOME Activity Journal – Sezen and Tracker.
Sezen is another neat utility that internally uses Zeitgeist. It is similar to GNOME Activity Journal in the sense that it also allows you to "browse" files. But it is more heavily oriented towards searching. To install Sezen enter the following command in the terminal :
sudo apt-get install sezen
Unfortunately, it does not have a menu option to launch and must be invoked from commandline. Of course, you can always add an launcher. To invoke it , type in a terminal :
This should start Sezen. You can notice that the screen looks remarkably pithy. It just has a textbox to enter query and few options to narrow down the filter. When you enter a query, all the results are shown organized by time. All files accessed today, yesterday, last week, last month etc are grouped in a temporal fashion. This is kinda the interface that I want Activity Journal to sport. Sezen also has a more sophisticated search than activity journal. As an example, I entered my query as blog. Files like "gajSezen.png" are selected even though it does not have the word "blog" in its name. The reason is that I have placed these images in a subdirectory of "blog" folder (ie blog/gaj/gajSezen.png) . This is very useful because you enter some search query for a directory and find which files you accessed recently and when. Neat !
Of course, there are lot of places where Sezen can improve – I do not think Sezen uses tracker’s full text search. It would be awesome to merge temporal, folder, content information and provide an unified search interface. Even better will be merge it with GNOME Activity journal. Similarly, it is not possible to select all images and documents. The filters behave like exclusive ones. If they can behave like checkboxes then it will be cool !
Tracker can be considered as a search engine for your local file system – in other words a desktop search utility. So far all Linux desktop search utilities suck. The recent versions of Tracker seem to be okay. GNOME Activity Journal uses tracker for search. Tracker can index files in your system and also their content. It has a full text search (fts plugin) that allows you to search based on their content,name and path. It can index a variety of file formats. One limitation of GNOME Activity Journal and Sezen is that they do not perform full text/content based search. If you want to find all the files that contain the word say "Gaussian Processes" then tracker is the way to go . Tracker is a dependency of Journal and must be installed with it. You can access it from Applications -> Accessories -> Tracker Search Tool.
You can find that Tracker interface is remarkably similar to GNOME Activity Journal or Sezen. I have given a search query of blog and you can see that not only it displays files with the word "blog" in their name but also the files which have the word "blog" in their content. So you can filter the results based on their file type : like documents, images etc
Now that we have covered the basics of the tools, lets delve into the details.
There are lot of tools that send their data to Zeitgeist without you doing anything on your own. For other applications they must be patched so that the data can be sent to Zeitgeist. Note that the information transfer can happen both the ways : Applications can send the files accessed to Zeitgeist and they can also get information about the file usage. eg Rhythmbox can use Zeitgeist to find the most used music files or the music files that are listened together. The potential is endless.
Lot of the applications though must be modified to send the data to Zeitgeist. Previously, there was a bunch of scripts that you must download to patch the applications to send their events. Now these scripts have matured and have become Linux packages on its own.
To install data providers, start synaptic and enter “zeitgeist-datasource” in the search window. You can see a huge list of applications for which providers are available like Vim, Emacs, Rhythmbox etc. Install the data sources for which you want the events to logged .
Zeitgeist – Docky Integration
If you are using Docky to have a jazzy dock in your system then you can make it even more cool by integrating it with Zeitgeist. To do that right click on Docky icon and select Settings. Go to the Docklets tab and enable the Recent Documents docklet. Go to Helpers tab and enable "Zeitgeist Integration" and "Zeitgeist Journal".
Now when you right click on any application icon in the dock (whether they are running or in dock already) you can see two new menu items : "Most Used Items" and "Most Recently Used Items". So if you want to open a file in gedit, right click the icon and select the file from the most used list and watch it open ! If Docky makes life easy, Zeitgeist integration makes you feel the joie de vivre.
1. If you are curious about the event flow, you can run Zeitgeist daemon in the command line. It outputs lots of verbose output and I learned lot about its workings from it. For eg in a terminal enter the following and go about your business. The logs will be displayed in your terminal.
2. Zeitgeist, GNOME Activity Journal, Sezen are all written in Python and are relatively small projects. Spend an evening skimming through the source files.
3. If you want to find how activities are stored internally check out the folder ~/.local/share/zeitgeist/. Specifically, take a look at the file activity.sqlite .
4. All the black listed items are encoded in JSON format in the file /home/neo/.local/share/zeitgeist/blacklist.json .
The post Integrating Zeitgeist into GNOME contains lot of excellent comments that indicate the potential applications of Zeitgeist. I have copied my favorite comments verbatim from there :
1. Imagine that smart playlists are powered by zeitgeist. You would get a whole slew of new options like "Songs I listen to while chatting with Babes" or "Songs I never listen to in the office".
2. Show you top 20 most listened song for the week/month/year and also show songs you never listened too.
3. If both Rhythmbox and Banshee would have been integrated with zeitgeist, we could have had (for an example) a playcount synchronised for every song. It would be useful when creating new dynamic playlists.
4. Software Center in Ubuntu can display the application usage count. For eg, this can indicate unused applications to customer which can be uninstalled to free space. Alternatively, you can collect apps in to groups and use the co-installation and usage count to recommend new packages to users. Isn’t it cool !
Zeitgeist , GNOME Activity Journal and Sezen are few of the GNOME utilities that I am pretty excited about. Even though their current features are limited, they have enormous potential and can be used to develop really cool applications. I have few plugins in my mind – for eg enhancing GNOME Do with Zeitgeist and few other plugins. I will write a post once something concrete is done.
Each of the tool has its own use. So use GNOME Activity Journal for finding which files you accessed when (even at granular level like which hour). If you want a more enhanced and generic search use Sezen. If you want to search based on their content then use Tracker.
1. GNOME Activity Journal – Contains lot of useful links and the usecases.
2. Zeitgeist – The magic tool behind GNOME Activity Journal and Sezen.
3. Sezen – No specific URL. Lot of useful posts in the link.
4. Tracker – Another neat project that GNOME Activity Journal internally uses and provides full text search.
5. Seif Lotfy’s blog : Has lot of useful news on Zeitgeist.