Ubuntu – Add and remove launcher icons from command line

12.10iconslauncher

I am building an Ubuntu 12.10 VM using Vagrant and Chef, and I want to control which icons initially appear in the launcher.

Specifically I want to clear out all of the initial launcher icons, just leaving the Start icon and Nautilous, then add icons for a couple of applications I'm installing with Chef.

Adding the icons I can probably handle from other posts, but how can I remove existing icons using only the command line?

Best Answer

  • To view the current ones:

    gsettings get com.canonical.Unity.Launcher favorites
    

    would output something like:

    ['nautilus-home.desktop', 'chromium-browser.desktop', 'gnome-system-monitor.desktop']
    
  • To add new entry, say vlc, add its .desktop file ie. vlc.desktop as:

    gsettings set com.canonical.Unity.Launcher favorites "['nautilus-home.desktop', 'chromium-browser.desktop', 'gnome-system-monitor.desktop', 'vlc.desktop']"
    

(those included in the value string "[... ... ...]" will be show up in the launcher. You can use this to add or remove the launchers of your choice.)

  • To reset to the default values:

    gsettings reset com.canonical.Unity.Launcher favorites