Again, all configuration data for the panels are stored in the GConf database under
/apps/panel.
I'll use the default settings from Ubuntu Lucid. Let's show that the properties for the panel item are stored under
/apps/panel.
For this exercise we will use the panel item's '
locked' property for the Firefox launcher.
This property is stored in the locked key and it's value type is boolean. The default value for the '
locked' property is TRUE. Get the value of the locked property from the GConf database:
Code:
gconftool-2 -g /apps/panel/objects/browser_launcher_screen0/locked
This will return a value of TRUE. Verify this by right-clicking on the Firefox icon. The 'Locked To Panel' menu item will be checked.
Now set the locked property to FALSE:
Code:
gconftool-2 --toggle /apps/panel/objects/browser_launcher_screen0/locked
Check that the locked property was set to FALSE:
Code:
gconftool-2 -g /apps/panel/objects/browser_launcher_screen0/locked
This will return a value of FALSE. Verify this by right-clicking on the Firefox icon. The 'Locked To Panel' menu item will now be unchecked.
Set the lock to it's original value:
Code:
gconftool-2 --toggle /apps/panel/objects/browser_launcher_screen0/locked
This simple exercise shows that the configuration data for the panels are indeed stored in
/apps/panel.
Quote:
I modify the shortcut property for the firefox icon in the panel, for it to invoke a program called foobar. The output from the gconftool-2 command you gave will not contain "foobar" anywhere in it.
|
Of course it will not. That's because the Firefox icon points to a '
Launcher'. This is what you are referring to as a shortcut, but that Windows' terminology, not GNOME's. In GNOME, it's called a
Launcher.
A launcher stored it's properties in a
.desktop file. This is the reason you do not see the launcher's properties listed in the GConf database. The GConf database simple stores the .desktop filename that the launcher points to. Have a look at
/usr/share/applications and you will see several .desktop files.
Now on to the launcher's properties. By default, the launcher for the Firefox icon is linked to the launcher for the Firefox icon in
Applications > Internet > Firefox.
Basically, there are two ways to modify the Firefox launcher.
- The simplest is by right-clicking on the Firefox icon and selecting Properties from the menu items. You can then change the properties of the launcher from the Launcher Properties dialog box. When you do this however, the link to the launcher pointed to by Applications > Internet > Firefox is broken and a new launcher is created in ~/.gnome2/panel2.d/default/launchers/firefox.desktop. If this is what you did when you changed the Command property to 'foobar', you will now have a ~/.gnome2/panel2.d/default/launchers/firefox.desktop file present.
Code:
ls ~/.gnome2/panel2.d/default/launchers
Check that the newly entered Command 'foobar' is actually in the firefox.desktop file:
Code:
grep ^Exec=.* ~/.gnome2/panel2.d/default/launchers/firefox.desktop
This will return:For the rest of this exercise, delete the newly created firefox.desktop file:
Code:
rm ~/.gnome2/panel2.d/default/launchers/firefox.desktop
and restart the panel:
Code:
gnome-panel --replace &
- If you want to keep the link to the launcher pointed to by Applications > Internet > Firefox, then you must modify the .desktop file for this launcher. This file is ~/.local/share/applications/firefox.desktop.
Check the Command that this launcher runs:
Code:
grep ^Exec=.* ~/.local/share/applications/firefox.desktop
Unless it was previously changed, it will return:Let's change the Command for this launcher to point to LQ:
Code:
sed -i 's,^Exec=.*,Exec=firefox http://www.linuxquestions.org,' ~/.local/share/applications/firefox.desktop
Check that the change was successfully:
Code:
grep ^Exec=.* ~/.local/share/applications/firefox.desktop
It will return:
Code:
Exec=firefox http://www.linuxquestions.org
Restart the panel:
Code:
gnome-panel --replace &
Now clicking on the Firefox icon will cause it to open LQ's homepage.
In conclusion, configuration data for the panel are stored in
/apps/panel but the properties for the launcher are stored in a .desktop file either in
~./gnome2/panel.d/default/launchers (for custom launchers) or in
~/.local/share/applications for system launchers for the logged in user.