Functions

check_version (required_major, required_minor, required_micro)

config_build_paths (filename)

config_lookup (filename)

get_environment ()

marshal_VOID__OBJECT_OBJECT (closure, return_value, n_param_values, param_values, invocation_hint, marshal_data)

set_environment (env)

set_environment_xdg (fallback_env)

Details

Garcon.check_version(required_major, required_minor, required_micro)
Parameters:
  • required_major (int) – the required major version.

  • required_minor (int) – the required minor version.

  • required_micro (int) – the required micro version.

Returns:

None if the library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by the library and must not be freed or modified by the caller.

Return type:

str

Checks that the garcon library in use is compatible with the given version. Generally you would pass in the constants Garcon.MAJOR_VERSION, Garcon.MINOR_VERSION and Garcon.MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of

garcon the application was compiled against.

Checking the runtime version of the garcon library
const gchar *mismatch;
mismatch = garcon_check_version (GARCON_VERSION_MAJOR,
                                 GARCON_VERSION_MINOR,
                                 GARCON_VERSION_MICRO);
if (G_UNLIKELY (mismatch != NULL))
  g_error ("Version mismatch: %<!---->s", mismatch);
Garcon.config_build_paths(filename)
Parameters:

filename (str) – name of .desktop file

Return type:

[str]

Garcon.config_lookup(filename)
Parameters:

filename (str) – relative filename of the config resource.

Returns:

the absolute path to the first file in the search path, that matches filename or None if no such file or directory could be found.

Return type:

str

Looks for the filename in the users’ config directory and then the system config directories.

Garcon.get_environment()
Returns:

Name of the desktop environment (e.g. XFCE, KDE, GNOME) which is used or None.

Return type:

str

Get the environment set with Garcon.set_environment().

Garcon.marshal_VOID__OBJECT_OBJECT(closure, return_value, n_param_values, param_values, invocation_hint, marshal_data)
Parameters:
Garcon.set_environment(env)
Parameters:

env (str) – Name of the desktop environment for which menus will be generated (e.g. XFCE, KDE, GNOME or None).

Sets (or unsets) the desktop environment for which menus will generated. Menus and menu items belonging to other desktop environments will be ignored. If set to None, all menu items are used.

Garcon.set_environment_xdg(fallback_env)
Parameters:

fallback_env (str) – fallback value

Set the desktop environment to the envvar XDG_CURRENT_DESKTOP. If this variables is not set, it falls back to default_env.

For fallback_env you can use for example Garcon.ENVIRONMENT_XFCE.

New in version 0.3.0.