Function i3status_rs::util::find_file

source ·
pub fn find_file(
    file: &str,
    subdir: Option<&str>,
    extension: Option<&str>
) -> Option<PathBuf>
Expand description

Tries to find a file in standard locations:

  • Fist try to find a file by full path (only if path is absolute)
  • Then try XDG_CONFIG_HOME (e.g. ~/.config)
  • Then try XDG_DATA_HOME (e.g. ~/.local/share/)
  • Then try /usr/share/

Automatically append an extension if not presented.