6

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?

1 Answers1

7

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.