Saturday, October 15, 2011

Creating Desktop Launchers in 11.10, Ubuntu Oneiric

As you might have already noticed, Oneiric doesn't let you create launchers by right-clicking the desktop. Different people have different needs, but I love to have CCSM and 'compiz --replace' launchers (at least) at my desktop so I can just double-click those whenever disaster strikes. Thankfully, there is a workaround for creating launchers at the desktop in Oneiric.

First of all, make sure that the package 'gnome-panel' is installed. It would do no harm, sitting there quietly. So, get to a Terminal and run:

sudo apt-get install --no-install-recommends gnome-panel

Now from the Alt + F2 run dialog or, even more conveniently, from a Terminal, run:

gnome-desktop-item-edit ~/Desktop/ --create-new

Name your launcher and enter the command to be launched as shown in the screenshot below. Clicking the 'OK' button would immediately create the launcher.

Copying Existing Launchers

The above method you primarily need to create custom launchers that aren't already present on your system; for creating launchers based on existing ones, there is a much easier method: simply copying them!

Therefore, navigate in Nautilus to '/usr/share/applications', there you'll find the vast majority of existing, system-wide launchers, and they'll be presented to you with the names and icons with which they also turn up in the Dash, Unity Launcher, and menus.

Now, you only got to do a simple copy & paste onto your desktop, whether directly on it or into its corresponding directory in your home directory. Done!

The executable bit will be automatically set, making the newly created copy of the concerning .desktop file a working launcher - it isn't set on the files in '/usr/share/applications' in the first place, since those aren't executed, but sourced. Fortunately, Nautilus automatically takes care of that; but if you copy the launcher files via the command line, e.g. the Terminal, you'd need to set it yourself!

User-Specific Launchers

User-specific launchers, including those of Wine and your possibly earlier created custom ones, are located in '~/.local/share/applications' in your home directory (press Ctrl + H to see the hidden files/directories). Their executable bit also isn't set by default, but unlike the system-wide launchers, they turn up in Nautilus with their actual file names and generic icons (Wine launchers have at least their public names in their file names). Also unlike system-wide launchers, Nautilus won't automatically set the executable bit upon creating the copy, so you'd need to set it yourself via 'Right-Click > Properties > Permissions'.

Related Posts:

Launcher , Oneiric Ocelot