Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

This question already has an answer here:

After a fresh install of 11.04 I have a script that does a few useful things. Is there a way to remove the LibreOffice, Ubuntu One etc icons from the Unity launcher using command line so I can put it in my script?

share|improve this question

marked as duplicate by Jacob Vlijm, Eric Carvalho, guntbert, David Foerster, muru May 10 at 21:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Get the list of launcher items:

    gsettings get com.canonical.Unity.Launcher favorites
    

    This will return something like:

    ['nautilus-home.desktop', 'gnome-terminal.desktop', 'gedit.desktop']
    

    which you can manipulate in your script (eg. using sed), and then

  • Set the launcher item list:

    gsettings set com.canonical.Unity.Launcher favorites "['gimp.desktop']"
    

    Don't forget the quotes.

share|improve this answer
    
I've had chance to try this now but it doesn't work. If it type: gsettings get com.canonical.Unity.Launcher favorites I get this: ['nautilus-home.desktop', 'firefox.desktop', 'libreoffice-writer.desktop', 'libreoffice-calc.desktop', 'libreoffice-impress.desktop', 'ubuntu-software-center.desktop', 'ubuntuone-control-panel-gtk.desktop'] If i then type: gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop']" Then check it again with gsettings get it seems to have changed, but after a reboot nothing alters and another gsettings get shows the original list? – Andy Spencer May 15 '11 at 11:56
    
Then you probably haven't installed the (default) package libdconf0 - it works just fine here. – htorque May 15 '11 at 12:19
    
did an apt-get install libdconf0 and it says its already the newest version. any other ideas why this isnt working on a fresh install? – Andy Spencer May 20 '11 at 7:33
    
Didn't work for me either. I'll take a look around – SimplySimon May 31 '13 at 22:23

try:

unity --replace

after

gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop']"

working on 12.04

share|improve this answer
    
+1 Works for me with 14.04, too. However I needed to daemonize it using ( unity --replace & ) from within a gnome terminal to update everything properly without risk of bad side-effects. – Tino May 25 '14 at 10:18

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