Configuring Compiz Using Gnome Configuration Tools

On Ubuntu systems, Compiz, the Compiz plug-ins, and the Compiz Fusion plug-ins can be configured using the standard GNOME configuration utilities without requiring that you install any special tools.

GNOME systems provide two primary configuration utilities for manipulating the GConf (GNOME Configuration Editor) repository: gconftool-2, a command-line utility, and gconf-editor, a graphical application. You should run these utilities as yourself, without using sudo, because they manipulate GNOME configuration information stored in each user's personal GConf repository. If you ran these utilities via sudo, you'd edit the GConf repository for the root user.

Information in the GConf repository is stored as key/value pairs that are organized into various hierarchical sections, much like the information in the Microsoft Windows Registry. Information about Compiz is stored in the /apps/compiz hierarchy. Information about specific plug-ins is hierarchically organized under /apps/compiz/plugins and the name of each plug-in.

gconftool-2 is a command-line line application that enables you to examine all or a portion of the GConf registry and set specific values by passing repository keys and new values on the command line. For example, the following command examines the settings for the Compiz Wobbly Windows plug-in:

$ gconftool-2 -R /apps/compiz/plugins/wobbly /apps/compiz/plugins/wobbly: /apps/compiz/plugins/wobbly/allscreens: /apps/compiz/plugins/wobbly/allscreens/options: shiver = false snap_key = <Shift> snap_inverted = false /apps/compiz/plugins/wobbly/screen0: /apps/compiz/plugins/wobbly/screen0/options: spring_k = 8 map_effect = 0

map_window_match = Splash | DropdownMenu | PopupMenu | \

Tooltip | Notification | Combo | Dnd | Unknown focus_window_match = friction = 3 focus_effect = 0 maximize_effect = true grab_window_match = min_grid_size = 8 grid_resolution = 8

move_window_match = Toolbar | Menu | Utility | Dialog | \ Normal | Unknown

The -R option tells gconftool-2 to recursively retrieve hierarchical settings below the specified repository key. Information about whether a given plug-in is enabled is stored in the / apps/compiz/general/ active_plugins repository entry, as shown in this example:

$ gconftool-2 -g /apps/compiz/general/allscreens/options/active_plugins [svg,ingjpeg,text,place,png,neg,workarounds,dbus,video,regex,\ resize,core,vpswitch,nove,resizeinfo,shift,extrawn,decoration,\ wall,animation,expo,ezoom,switcher,fade,scale,scaleaddon,scalefilter]

As with all examples of command-line utilities in this book, the \ character is used at the EaH&Kzi&laSKnQB- end of text lines that are too long to be correctly displayed in the running text of this book.

You would not see this character in actual output, and you should not use this character, the subsequent newline, or any spaces at the beginning of the next line when actually typing commands, as shown in the examples.

The -g option retrieves the value of the specified repository key. The output from this command shows that the Wobbly Windows plug-in is not currently enabled.

To activate the Wobbly Windows plug-in from the command line, you would use the -s option, which lets you set the specified repository key to a specified value. The -s option must be used with the --type option to identify the type of the value that you are setting. Valid options for the - -type option are bool (Boolean), float (floating point numeric value), i nt (integer), list (a list of values of types bool, float, i nt, or string), pair (two distinct values), or string (a string of text). Identifying the type of value being set is required so that gconftool-2 can determine, for example, whether the value true is the string true or a Boolean value.

The command to set the active_plugins repository key to a value that activates the Wobbly Windows plug-in is something like the following:

$ gconftool-2 -s /apps/compiz/general/allscreens/options/active_plugins \ '[svg,imgjpeg,text,place,png,neg,workarounds,dbus,video,regex,resize,\ core,vpswitch,move,resizeinfo,shift,extrawm,decoration,wall,animation,\ expo,ezoom,switcher,fade,scale,scaleaddon,scalefilter,wobbly]' \ --type list --list-type string

You must begin and end lists with the characters [ and ] in order to delimit the lists. Once you execute this command, reexamining the value of the active_plugins key shows that the Wobbly Windows plug-in is now in the list of active plug-ins:

$ gconftool-2 -g /apps/compiz/general/allscreens/options/active_plugins [svg,imgjpeg,text,place,png,neg,workarounds,dbus,video,regex,resize,\ core,vpswitch,move,resizeinfo,shift,extrawm,decoration,wall,animation,\ expo,ezoom,switcher,fade,scale,scaleaddon,scalefilter,wobbly]

You can also confirm that this plug-in is enabled by using your mouse to grab the title bar of any window and move that window. There's always room for Jell-O!

gconftool-2 can be very useful for quickly querying and manipulating GConf settings from the command line. However, gconftool-2 is probably not the right tool for setting the "right" GConf keys, identifying possible values, and iterating through multiple settings and values until you get the effect that you're looking for. I'm a big fan of command-line tools, but I'm no purist — in most cases, graphical tools are more usable than command-line tools, especially when you need to perform a number of change and test cycles when experimenting with configuration values.

GNOME's graphical tool for examining and editing the GConf repository, gconf-editor, is installed by default on GNOME-based Ubuntu systems. You can start the gconf-editor tool from any command-line environment. As with gconftool-2, you want to start gconf-editor as yourself, not via sudo, so that you are editing only the contents of your personal GNOME repository.

Figure 6-2 shows gconf-editor when it's first started. To locate a specific repository key, click the Edit C> Find command to display the dialog shown in Figure 6-3.

Enter the name of the key that you want to search for (active_plugins in the figure) and select the Search also in key names option to expand the types and places that are being searched for the specified key. By default, gconf-editor looks for only the search string you specify in key values. In this case, you want to search key names because the list of active plug-ins is stored as the value of the /apps/com-piz/general/active_plugins. After you click Find, you'll see a screen like the one in Figure 6-4, in which the matching keys are listed in the bottom pane. Select the /apps/compiz/general/ active_plugins key to display the view shown in Figure 6-4.

figure 6-2

The graphical GNOME configuration editor

The graphical GNOME configuration editor

FIGURE 6-3

Searching for a repository key

FIGURE 6-3

Searching for a repository key

FiGURE 6-4

Repository matches for a search

Wnrttw/iHMaïïl. nmifa file Edit Bookmarks ]Help t> 1*1 baobab t? ûcJ hattstat-applef t> ¿a blackjack u bluetooth-manager D> lad brasero " compiz ¿2 general

"V bd aIIiti ««rii L"j options > Ù screeno Î' plugins

Ltasi corilrul-miliar > b-l deskbar t1 id drivemount applet t> tai ekiga

0

Name

v value

active_pluginG

: [corc.dbus.plac

y audible bell

m

§ auloi ¡¿¡it?

0 autoraise_delay

1000

@ click_to_focus

ra

@ close window button

Disabled

Q dose_windnw_key

<Alt>F4

Key DnrumpntflMnn

Key DnrumpntflMnn

Key name: /apps/compiz/qeneral/allscreens/options/actfv'e

Key owner: eompi7

Short description: Active Plugms

Long description: List of currently active plugins

□ fa pp s/eog/plugin s/active_plugins

/apps/c ompiz/ge neral/allscre en s/optio ns/active_plu gins

/schemas/apps/eoq/plugins/actf\/& pluqins f /idierrias/appa/coiitpii/gerier al/allitr e y i ty/opli uns/acLive_pluy iiii

/apps/c ompiz/genera l/allscre ens/options/act rve_plu gins

To edit an existing key, right-click the name of that key and select Edit key from the pop-up menu. You'll see the dialog shown in Figure 6-5.

FIGURE 6-5

Editing a key value

FIGURE 6-5

As you can see from Figure 6-5 (and from the examples earlier in this section), the value of the /apps/ compiz/general/active_plugins key is a list of plug-in names. If the Wobbly Windows plug-in is not present in this list (which it is not by default, but you may have added it earlier in this section if you're following along), click the Add button to display the Add New List Entry dialog shown in Figure 6-6.

FIGURE 6-6

Adding a new entry to a key value list

FIGURE 6-6

Enter wobbly as the new list value and click OK. The Wobbly Windows plug-in will be active at this point. You can then select File C> Quit to close the gconf-editor application.

Both the gconftool-2 and gconf-editor tools provide a generic interface to the GNOME configuration registry. While these tools provide a completely functional mechanism for examining, adding, and modifying repository key values, they simply see the repository as a hierarchical set of key/value pairs and thus see every configuration task as being essentially equivalent.

Unlike these standard GNOME registry configuration tools, the tool discussed in the next section was designed for manipulating Compiz and Compiz Fusion plug-ins, and can therefore make use of plug-in-specific information to provide an easier-to-use, smarter plug-in configuration tool.

Was this article helpful?

0 0
Get Paid to Take Digital Photos

Get Paid to Take Digital Photos

Reasonable care has been taken to ensure that the information presented in this book is  accurate. However, the reader should understand that the information provided does not constitute legal, medical or professional advice of any kind.

Get My Free Ebook


Post a comment