Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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:

SELECT
  subj_id,
  MAX(timestamp) as timestamp,
  COUNT(subj_id) as num_events
FROM
  event_view
GROUP BY
  subj_id
ORDER BY
  num_events DESC
  timestamp DESC

Isn't open source beautiful?

share|improve this answer
    
To add, the application launching is logged by another daemon called zeitgeist-datahub which feeds this data in the main zeitgeist engine(running as the daemon). There is a desktop-launch-listener which listens to app launching –  Manish Sinha Jan 28 '12 at 18:16
    
@ManishSinha Added this in, thanks –  Jjed May 11 '12 at 0:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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