How To: Create Custom Quick Lists in Ubuntu 11.10

T

theZUDreport

Guest
If you are using Ubuntu's default user interface Unity, then you are probably familiar with Quick Lists. They are those handy menus that pop up when you right-click on an icon on the Launcher on the left of the screen, giving you options like Keep in Launcher or Quit. Some apps give you more options, but wouldn't it be nice if you could change those options, or better yet... make your own custom Launcher?
View attachment 71So, let's say you don't just want options for a single app, but you want a menu with your favorite or most used apps. Now, me personally, I like to keep my launcher clean, but I don't always want to go to the Dash for my most used apps, so I made my own Favorites menu to add to the Unity Launcher. For this tutorial, I'll show you how I made the Quick List Launcher for my most used apps: Audacity, EasyTag, Gimp, NixNote, OpenShot, WinFF and Writer
1st, we'll need to create a file to tell the Launcher how to behave, in Ubuntu 11.10 it's a little different then it used to be. Open your Terminal and paste the following code in to create the file (all on one line):
Code:
gnome-desktop-item-edit /usr/share/applications --create-new
You will get a Create Launcher window, asking for the following information. For Type leave it as the default Application, Name you can make whatever you like... I called mine Favs, for now you can leave Command and Comment blank. This will create a Launcher called Favs in the folder /usr/share/applications the we can now edit.

Next, to edit our newly create Launcher press the Alt+F2 keys at the same time to bring up the Run Prompt and enter:
gksu gedit
View attachment 72

Then press Enter. You might be asking “Why do I need to open gEdit this way?” By using gksu you are temporarily giving gEdit the authorization to edit protected files, and since our Launcher is in /usr/share it's protected. Once gEdit opens, we now need to open our file, click Open then navigate to our file location... start by clicking File System on the left, then in the main panel navigate to /usr → /share → /applications and locate our file, it will be labeled as whatever you named it, mine is Favs.desktop. When it opens, you'll have something like this:

Code:
#!/usr/bin/env xdg-open 

[Desktop Entry] 
Version=1.0 
Type=Application 
Terminal=false 
Icon[en_US]= 
Name[en_US]=Favs 
Exec= 
Comment[en_US]= 
Name=Favs 
Comment= 
Icon=
There are a couple things that can be changed here, 1st you'll notice the 4th line: Exec= has no value assigned to it, this means that left clicking on the icon will do nothing. You can set this to open the most used app in the list, for example, if you use GIMP more often than the other apps you could write that line as follows:
Exec=gimp

Also, the line: Icon=multimedia can be changed to any icon in your icon set, or if you want to use your own icon you can put the path of the icon there. I used my own icon so I put my icon in my Home folder and in my file that line looks like this:
Code:
Icon=/home/z/favs.png

Next we need to tell the Launcher what shortcuts to look for, this will be different for you depending on what apps you want in your list. The names of the shortcuts aren't important (below I have them listed as Shortcut1..2 etc, but naming them as the app name is probably easier), you can call them whatever you like, but make sure you put them in the order you want them listed, this is where we name the Quick List as well:
Code:
X-Ayatana-Desktop-Shortcuts=Shortcut1;Shortcut2;Shortcut3;

Name[en_US]=Favorites
Finally we need to build the shortcuts. Each shortcut has four lines: first line is the name of the shortcut group (same names as you created above.. IE. Shortcut1, Shortcut2, Shortcut3), second line is the Name, this is how you want it listed in the Quick List, third is Exec, this is the command you would use as if you were opening the app from Terminal (ie: GIMP would be Exec=gimp) and fourth is TargetEnvironment, to tell the app where to open, and it's always the same. For each shortcut in your Quick List you'll have something like this:
Code:
[Shortcut1 Shortcut Group]
Name=Shortcut1 Name
Exec=shortcut1-command
TargetEnvironment=Unity

So, if you have three apps, you'd have three groups like this... I have seven, so I have seven groups like this. Now, save your file, then navigate to it's location by going to your Home folder, in the left panel go to File System and then in the main panel navigate to /usr → /share → /applications

Once there locate the file we just created called Favs.desktop and drag it into your Unity Launcher. You can do this for any group of apps you like just create a new .desktop file, named in a way you'll know what it's for, and just repeat what we did here.

If you want to see my file, to get an idea of what it should look like all completed, I've included it below. Just remember that yours will be different depending on what apps you choose to put in the Quick List. Hope this helps.
View attachment 73

Code:
#!/usr/bin/env xdg-open 
[Desktop Entry] 
Name=Favs 
Comment=Quick Access to My Favorites 
Exec= 
Terminal=false 
Icon=/home/z/favs.png 
Type=Application 
Categories=Network;WebBrowser; 
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp; 

X-Ayatana-Desktop-Shortcuts=Audacity;EasyTag;Gimp;NixNote;OpenShot;WinFF;LibreWriter; 

Name[en_US]=Favorites 

[Audacity Shortcut Group] 
Name=Audacity 
Exec=audacity 
TargetEnvironment=Unity 

[EasyTag Shortcut Group] 
Name=EasyTag 
Exec=easytag 
TargetEnvironment=Unity 

[Gimp Shortcut Group] 
Name=Gimp 
Exec=gimp 
TargetEnvironment=Unity 

[NixNote Shortcut Group] 
Name=NixNote 
Exec=nixnote 
TargetEnvironment=Unity 

[OpenShot Shortcut Group] 
Name=OpenShot 
Exec=openshot 
TargetEnvironment=Unity 

[WinFF Shortcut Group] 
Name=WinFF 
Exec=winff 
TargetEnvironment=Unity 

[LibreWriter Shortcut Group] 
Name=LibreWriter 
Exec=libreoffice –writer %U 
TargetEnvironment=Unity
 

Attachments

  • DefaultQL.png
    DefaultQL.png
    35.6 KB · Views: 1,477
  • CustomQL.png
    CustomQL.png
    53.2 KB · Views: 1,407
  • CreateLauncher.png
    CreateLauncher.png
    29.1 KB · Views: 1,095
  • NautFS.png
    NautFS.png
    80.1 KB · Views: 1,188


Top