How can I set default applications in Unity Launcher for other users?

6,380

Those settings are in the schema "com.canonical.Unity.Launcher", key "favorites" in the com.canonical.Unity.gschema.xml file under the /usr/share/glib-2.0/schemas/ directory.
Then those xml schemas are compiled in a binary file with the name gschemas.compiled that can be used by GSettings.

To change those settings you can edit the com.canonical.Unity.gschema.xml file, but in my opinion the best way is to create .gschema.override file. (to overwrite the default settings).


NOTE:I recommend you to do this in a Virtual Machine or in a Test Machine to see is everything is OK.
In this example I wil create a gschema.override file to edit the applications in the Unity Launcher. It will show by default only Nautilus & Gedit.


1) To see the default values you can open a Terminal window Ctrl+Alt+T and type:

  • sed -n 52p /usr/share/glib-2.0/schemas/com.canonical.Unity.gschema.xml

The Result:

<default>[ 'application://ubiquity.desktop', 'application://nautilus.desktop', 'application://firefox.desktop', 'application://libreoffice-writer.desktop', 'application://libreoffice-calc.desktop', 'application://libreoffice-impress.desktop', 'application://ubuntu-software-center.desktop', 'application://ubuntuone-installer.desktop', 'application://ubuntu-amazon-default.desktop', 'application://UbuntuOneMusiconeubuntucom.desktop', 'application://gnome-control-center.desktop', 'unity://running-apps', 'unity://expo-icon', 'unity://devices' ]</default>

Or with dconf-editor.

  • sudo apt-get install dconf-editor

enter image description here

The .desktop files are the default applications in the Launcher.

nautilus   
firefox  
libreoffice-writer   
libreoffice-calc  
libreoffice-impress 
ubuntu-software-center   
ubuntuone-installer   
ubuntu-amazon-default   
UbuntuOneMusiconeubuntucom   
gnome-control-center

2) To create a gschema.override type:

  • sudo nano /usr/share/glib-2.0/schemas/99_launcher.favorites.gschema.override

The format would be:

[Schema]
key = values

The content of the 99_launcher.favorites.gschema.override would be:

[com.canonical.Unity.Launcher]
favorites = ['application://nautilus.desktop', 'application://gedit.desktop', 'unity://running-apps', 'unity://expo-icon', 'unity://devices']

Save the changes with Ctrl+O,Enter then Ctrl+X.

3) Compile the schemas.

  • sudo -i

  • glib-compile-schemas /usr/share/glib-2.0/schemas/


Now you can create a new user , Login as the new user to see the new default icons in the Launcher.

NOTE: To add your programs by default in the system-wide, you need the .desktop file for each application under /usr/share/applications/ directory.


Default:

enter image description here

New Default:

enter image description here

Hope this helps.

Share:
6,380

Related videos on Youtube

Doka
Author by

Doka

Updated on September 18, 2022

Comments

  • Doka
    Doka over 1 year

    So I'm the first user on Ubuntu 13.10, and want to add other users as well. How can I change the default applications in Unity Launcher in a way that all new users will find my set of applications in the Launcher, and not the default ones, like Amazon, Ubuntu One, or the Libreoffice staff?