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 wanting to find the Unity scope folder so that I can study how the scopes are set up and programmed. Where on the filesytem could I find the Unity scope files?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Documentation on the Unity scope API can be found here. That information should be current for 13.04, but there are some changes coming in 13.10 which merge the concepts of lenses and scopes.

Unity discovers its lenses and scopes by looking for files under /usr/share/unity/lenses (or /usr/share/unity/scopes for 13.10) with a suffix of .lens or .scope.

These files are similar to desktop entry files, but instead of specifying a command to execute, they specify a D-Bus endpoint to use to talk to the lens or scope through the DBusName and DBusPath keys.

If the scope or lens is not running when the shell tries to communicate with it, the D-Bus daemon will activate it. This is done by scanning /usr/share/dbus-1/services for a .service file whose Name key matches the desired bus name, and running the command in the Exec key. So it is not too difficult to discover what program implements a particular scope with a simple grep command.

If you are interested in writing a scope of your own, I would suggest looking at the documentation in the first link. But keep in mind that you may have to adjust your scope a bit when 13.10 comes out.

share|improve this answer
1  
Thank you for are detailed and clear answer. This is the best answer I have ever received on the Internet. –  Devyn Collier Johnson May 21 '13 at 12:35
    
This question is referenced on developer.ubuntu.com (developer.ubuntu.com/scopes/cookbook) so it would be nice if the answer was updated now that 13.04 is history and we're getting closer to the next LTS. –  Jo-Erlend Schinstad Feb 3 at 12:25
    
It is still valid for the scopes framework being used by Unity 7. We're still working out the details for the new framework, so it's a bit premature to update the question just yet. –  James Henstridge Feb 3 at 13:29
add comment

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.