github lens — now with previews

After reading Michael Hall’s blog about adding Unity Previews to Singlet, I knew it was something I needed to add to my singlet lenses.  The most obvious choice to me was allowing users to git clone a GitHub repo from the Preview.  After a couple days of experimenting, I finally figured out what to do and how to do it.  Instead of git cloning repos into any random directory, I had the lens search for a gconf key for your “Projects Directory”, where you would want to git clone projects to.  (In my case, ~/Projects).  That gconf key is found at /app/unity-lens-github/project-dir.  If you don’t supply a directory, it will default to your home directory.

If you search @username, it will use the users gravatar as an image

To get some feedback for the user, I decided to run git clone in a newly opened gnome-terminal, as well as to ensure no hiccups happened along the way.

Github Lens Previews from chris wayne on Vimeo.

The lens is again available in the Scopes Packagers PPA. To upgrade simply run apt-get update && apt-get upgrade. To install, run:


Note that this update will only be available for 12.10 users, and you will need quantal-backports enabled to get the updated version of python-unity-singlet.

Posted in Uncategorized Tagged , , , .


  1. Martin Owens December 7, 2012 at 4:58 am #

    It looks like your moving towards groundcontrol functionality. I have basic github support in gc 2.0 alphas, but you’ve gone for a direct push into the scopes.

  2. bochecha December 7, 2012 at 5:50 am #

    GConf? Shouldn’t you use GSettings instead?

    It looks pretty good though!

    Maybe cd to the clone after cloning it?

  3. toabctl December 7, 2012 at 8:40 am #


    gconf is deprecated. Please use gsettings.

  4. cwayne December 7, 2012 at 3:07 pm #

    Thanks to everyone pointing out the issue with gconf, I’ll look into using gsettings insetead

  5. cwayne December 7, 2012 at 3:11 pm #

    @bochecha That’s a good idea, I’ll do that!

  6. chilicuil December 10, 2012 at 8:18 am #

    wowo, pretty good!, thanks for sharing it

2 Trackbacks

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">