6

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?

0

2 Answers 2

5
  • 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.

4
  • 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? May 15, 2011 at 11:56
  • Then you probably haven't installed the (default) package libdconf0 - it works just fine here.
    – htorque
    May 15, 2011 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? May 20, 2011 at 7:33
  • Didn't work for me either. I'll take a look around
    – Simon
    May 31, 2013 at 22:23
2

try:

unity --replace

after

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

working on 12.04

1
  • +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, 2014 at 10:18

Not the answer you're looking for? Browse other questions tagged .