Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 9 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
1  
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. –  Pete Howell Nov 30 '13 at 19:15
    
@Pete Howell: Why not ? Works perfectly on my machine. –  WitchCraft Dec 6 '13 at 6:27
add comment

Your Answer

 
discard

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.