pub fn new_from_default(conn: &impl Connection) -> Result<Database, ReplyError>
Expand description

Create a new X11 resource database from the default locations.

The default location is a combination of two places. First, the following places are searched for data:

  • The RESOURCE_MANAGER property of the first screen’s root window (See new_from_resource_manager).
  • If not found, the file $HOME/.Xresources is loaded.
  • If not found, the file $HOME/.Xdefaults is loaded.

The result of the above search of the above search is combined with:

  • The contents of the file $XENVIRONMENT, if this environment variable is set.
  • Otherwise, the contents of $HOME/.Xdefaults-[hostname].

This function only returns an error if communication with the X11 server fails. All other errors are ignored. It might be that an empty database is returned.

The behaviour of this function is mostly equivalent to Xlib’s XGetDefault(). The exception is that XGetDefault() does not load $HOME/.Xresources.

The behaviour of this function is equivalent to xcb-util-xrm’s xcb_xrm_database_from_default().