I am aware that something called Zeitgeist is used to determine the "Most Frequently Used" part of the unity dashboard, but i was wondering what the specifics where. I know the amount of applications in this section varies, so it's not as simple as the # with the most uses today.

Is there any (relatively) simple way of expressing the rules which dictate the listing and ranking of Most Frequently Used?


Basic answer

Simply put, the Most Frequently Used scope sorts applications by the number of times you've launched them. That is to say, if you've launched Firefox 1000 times, and Chromium 999 times, Firefox will be listed first. Even if you haven't launched Firefox in months and months.

Technical answer

Simply put, the Most Frequently Used scope is a wrapper that searches a Zeitgeist.Index of installed applications with a result type of MostPopularSubjects. Zeitgeist measures this popularity with the zeitgeist-datahub daemon, which notices and updates its statistics each time you launch an application. You can look at the relevant lens code here, and the API documentation for Zeitgeist here.

Having looked at the current Zeitgeist code, it appears MostPopularSubjects is a simple sort by number of accesses. Additionally, given the same number of application accesses, the applications are sorted by newest first. It's a little more complex than this, but the SQL generated for a Most Frequently Used request is more-or-less:

  MAX(timestamp) as timestamp,
  COUNT(subj_id) as num_events
  num_events DESC
  timestamp DESC

Isn't open source beautiful?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.