Function deskulpt::config::read_widget_config

source ยท
pub(crate) fn read_widget_config(
    path: &Path,
) -> Result<Option<WidgetConfig>, Error>
Expand description

Read a widget directory into a widget configuration.

This function reads the deskulpt.conf.json file and optionally the package.json file in the given widget directory path.

If widget configuration is loaded successfully, it will return Ok(Some(config)). If the directory does not represent a widget that is meant to be rendered, it will return Ok(None). Any failure to load the configuration will return an error.

The cases where a directory is not meant to be rendered include:

  • deskulpt.conf.json is not found.
  • The ignore flag in deskulpt.conf.json is set to true.