Ubuntu Natty Narwhal is here, yep, 11.04 has landed. (Is it just me or is there less Internet fanfare than before?) Along with Natty came the much discussed, loved-hated, maligned-adored, yet universally greatly expected Unity Interface.

Love it or hate it, I believe that most on-line opninionistas that has followed the roll-out of Unity to date has missed something that Unity might make possible in the near future – an application-rich environment.

A Word on Unity

Unity is now the default desktop interface for Ubuntu 11.04. I believe it should still be marked Beta, or at least come with a “you might be missing some of your favorite features” caveat. I think that Canonical would agree, given that they have included Gnome 2 as a desktop option with this release.

One of the most complained about areas, and I have noted this particular issue in a previous post regarding Unity, is the lack of support for Gnome Panel Applets like System Monitor.

With this release some of the features or applications for Unity, or at least support for some of it’s customization features are not included with the default install.

Unity cries out for the inclusion of the Compizconfig Settings Manager – something that I have complained about being missing in Ubuntu for every release that has had a Compiz Managed Desktop.

In short, the installation of Unity that users are being given right now is not feature complete – and I can see the argument why it was not done – Unity is a prime target for lambasting, and giving users the whole tool-set to potentially break Unity in new and creative ways would have done more harm than good at this point in the Unity lifecycle.

A Snap of My Unity LauncherBut it IS very Customizable!

This is not a “How to customize your Unity” blog entry, I might do one later – I certainly had fun tweaking mine and unlocking some hidden features this past weekend – but I will point out that Unity is immensely tweakable, and customizable.

I have not found point-and-click theming support yet, I don’t think it supports GDM theming just now, but you can edit the images that comprises the Unity look and feel already.

There is something else though, and for this post we will be focusing on the Launcher, and more specifically the Launchers that live on it.

That Application Rich Environment

Unity is making it deceptively easy for people to make their own applications, Apps if you will – if Steve Jobs and Apple will allow me to use the term without suit being filed somewhere. Right now people are building custom Unity Launchers and Quicklists, expanding their default launchers with quicklists, and also “Lenses.”

Lenses

Let’s first deal with Lenses first – at the moment the correct term is Places. The default Places that come pre-installed with Unity are the “Applications” and “Files and Folders” places that you find immediately below the “Workspace Switcher”.

First of, the term “Places” will be retired in favor of “Lenses” come 11.10 – Oneiric Ocelot. When you click on one of them they interact with the Dash, the menu that comes down from the top left corner of your screen where the Ubuntu logo lives. They offer a bit more advanced capabilities than your regular “Launchers” do, and are a bit harder to build.

When I read through the Unity/Lenses Ubuntu Wiki entry I came across this:

Lenses are something that we can put in extras.ubuntu.com since they’re small and can be quick moving and we want people making lots of them. This gives us the rest of the development cycle and Natty’s lifecycle for people to submit Places that people can run on their stable release without digging around for PPAs.

(emphasis mine)

To me the bolded part reads like a plan for third-party Lenses for Unity. Some might call them Apps, all I know is that they are the single biggest driving force behind Operating System popularity in the last few years.

The fact that Unity allows people to build these is exciting. Will Canonical have a “Lens Market” where developers can sell their Lenses? I don’t know. That would be cool, but it would be very speculative to explore that angle further.

Launchers and Quicklists

My Twitter Launcher Quicklist

Twitter Quicklist

Launchers also live in the Unity …erm… Launcher. Think of them as fancy Desktop Shortcuts. They are fancy for one reason though, quicklists.

Quicklists are those lists that show when you right-click on a launcher. With a default Ubuntu Natty install the Applications and ‘Files and Folders’ Places/Lenses have the best implemented Quicklists.

Quicklists can be added to any Unity Launcher. In fact, the “Keep In Launcher” dialog is a quicklist already, so every Launcher has one.

Right now a Launcher, on a technical level, is also a desktop shortcut. The filename is the same $application.desktop.

See the Twitter Launcher with it’s fancy Quicklist in the screenshot to the right? That is twitter.desktop and I built that in about thirty minutes. Below I am going to show you how.

Launchers and Quicklists’ Dirty Secret

Because Launchers (some say the correct term for them are “Launcher Items”) are in effect desktop shortcuts displayed from a different folder they call the applications they represent in precisely the same manner – a shell command. Even better, Quicklists do exactly the same thing!

This means that you can create a Launcher to launch any program by inserting the correct command in the correct format in a .desktop file. And this means that in your Quicklist syntax you can create other commands and have your Quicklist entry execute each of them when you click on the relevant entry!

In effect, if you build your own program, or App *koff* you can have it called and manipulated from your launcher and Quicklist. I have used this method with Qmmp (a nice Winamp type music player) to build a Quicklist that utilizes the Qmmp command-line switches to skip songs, pause, play etc right from the Quicklist. You can do that with Banshee as well.

I am going to keep things simple though, and show you how to build yourself a Twitter Launcher, with a Quicklist that uses Chromium-browser to open the relevant pages for your twitter feed, all from the Unity Launcher.

Custom Twitter Launcher and Quicklist

Building this launcer is deceptively easy, before you begin you will need to do some basic housekeeping.

  1. If you do not have one already, I didn’t, make a directory /home/YOURUSERNAME/.local/share/applications
    This is where your Launcher’s shortcut will live.
  2. Also create one: /home/YOURUSERNAME/.local/share/pixmaps
    This is where your Launcher’s Icon will live. To date I have only used PNG files. I don’t know if others will work at all.
  3. Get, or make yourself an Icon, and save it in /home/YOURUSERNAME/.local/share/pixmaps/twitter.png
  4. Next, open Nautilus and ask it nicely to show you hidden files and folders, and browser to .local/share/applications/
  5. Once there, right click and create a new blank file, call it twitter (DO NOT ADD THE .desktop PART NOW)
  6. You can replace “chromium-browser” in your file with ‘firefox’ – just make sure that you test the commands in a terminal and that they work before you put them in the file.

Now we are ready to begin, comrade…

Every .desktop file for the Unity Launcher has a similar structure, each of the below you can copy and paste into the same file.

First Off:

[Desktop Entry]
Version=1.0
Name=Twitter
Exec=chromium-browser "http://twitter.com/#!/"
Terminal=false
Icon=/home/quintin/.local/share/pixmaps/twitter.png
Type=Application
Categories=Network;WebBrowser;

If you leave it here you will have a Launcher Item that opens Chromium-browser and goes to Twitter.com. If you have cookies active (which you must for the Quicklist to work) you will be already logged in and at your Twitter Feed. (For each of the following pieces of code put a blank line under the previous block of code, it makes it easier to read.)

We want more though, so we add:

X-Ayatana-Desktop-Shortcuts=Mentions;Retweets;Messages;Followers;Following

This tells your Quicklist which of the following entries to look for and list. If the names after the = are different than the headers for each Quicklist entry they will not be displayed.

Go ahead and add:

[Mentions Shortcut Group]
Name=New @Mentions
Exec=chromium-browser 'http://twitter.com/#!/mentions'
TargetEnvironment=Unity

The first part is the name of the Quicklist Entry – note that the first word in that line after the Square Bracket [ is the same as the first word in the Desktop Shortcuts list after the equals sign.

The next line, that starts with "Name" is the text that will appear in your Quicklist. It can be anything, but best keep it short and descriptive, unless you want to add a cryptic shortcut to your fave Justin Bieber site, I'm not judging.

Next up, "Exec". Yeah, this is where you put your command that you want to execute. Try it out in a terminal if unsure, and use it exactly as you would in a terminal.

Finally you round it off with "Targetenvironment=Unity"

And You are done with part one!

If you want to you can click on 'FILE' and 'SAVE AS' and save your file as twitter.desktop

In Nautilus click on this file and drag it to the Unity Launcher, or Sidebar. It will appear there, resplendent with your epic Twitter Icon, and if you Right-Click on it you will be presented with a Quicklist that, if you click on it the @mentions line, will take you to your Twitter Feed that shows your mentions.

But you want more, don't you? Go ahead and add the rest to your file:


[Retweets Shortcut Group]
Name=Your Tweets Retweeted
Exec=chromium-browser ‘http://twitter.com/#!/retweeted_of_mine’
TargetEnvironment=Unity

[Messages Shortcut Group]
Name=Direct Messages
Exec=chromium-browser 'http://twitter.com/#!/messages'
TargetEnvironment=Unity

[Followers Shortcut Group]
Name=Your Followers
Exec=chromium-browser 'http://twitter.com/#!/followers'
TargetEnvironment=Unity

[Following Shortcut Group]
Name=You Follow
Exec=chromium-browser 'http://twitter.com/#!/followers'
TargetEnvironment=Unity

Once done and saved, if you have dragged the twitter.desktop to the Launcher already, drag the Launcher Icon (not the .desktop file!) to the trashcan in your Launcher and drag the new twitter.desktop to your launcher.

When you right-click on it now you will have a more complete Quicklist menu.

Summary

And there you have it, a nifty Twitter Launcher with Twitterrific Quicklist Shortcuts. I have used Quicklists and Custom launchers to expand my Nautilus menu with a Quicklist for my Documents, Pictures, Music, Downloads and Videos folders. I made one to log-in to gmail, or open the compose message dialog of Gmail right from the quicklist. I even made one that replaced all the Libre-Office Launcher Items with one that has a Quicklist for Writer, Impress, Calc, Math and draw.

Not to forget the schweet one I built for QMMP mentioned above.

So there you have it. If you keep to the basic structure explained above you will be able to do almost anything with Launchers and Quicklists that you want. It is a quick and easy way to build your own custom little Applications.

Now who said Unity was not customizable?

No related posts.