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?
Asked
Active
Viewed 3,695 times
2 Answers
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.

htorque
- 64,798
2
try:
unity --replace
after
gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop']"
working on 12.04

itagomo
- 734
-
+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
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:56libdconf0
- it works just fine here. – htorque May 15 '11 at 12:19