Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Although there are several posts on the Internet on the subject, I did not find a solution yet:
my goal is to find a command that adds an icon (.desktop file) to the Unity launcher and shows it immediately. when I open dconf-editor (desktop > unity > launcher) and I add an item to the favorites list, it shows at once in the launcher, so my idea is that it must be possible to do the same thing by command. The solutions I found so far on the Internet do not do the job.

I need to do it by command, to use in a quicklist editor I am working on.

You would make someone unbelievably happy if you could help out

share|improve this question
up vote 10 down vote accepted

You can act on dconf also with gsettings tool.

gsettings set com.canonical.Unity.Launcher favorites "$(gsettings get com.canonical.Unity.Launcher favorites | sed "s/, *'yourapp' *//g" | sed "s/'yourapp' *, *//g" | sed -e "s/]$/, 'yourapp']/")"
share|improve this answer
perfect, absolutely perfect, thanks!! – Jacob Vlijm Jun 20 '12 at 14:27
@Jacob, @jasmines This does not work in a chroot environment. gsettings says twice ** (process:10439): WARNING **: The connection is closed, but does not change the value (get still returns the old one). Any hint about this? Isn't this value stored in a plain text file somewhere? – Didier Trosset Oct 4 '12 at 7:18
@Didier Trosset, You cannot run gsettings as root -- it must be run as your userid. – user220845 Nov 30 '13 at 19:15
@Pete Howell: Why not ? Works perfectly on my machine. – WitchCraft Dec 6 '13 at 6:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.