From c6c8962d8776db5a82eabee6894acf76525b8c52 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Mon, 18 Mar 2024 10:21:33 -0700 Subject: [PATCH] fix: look up $XDG_DATA_DIRS/pixmaps in addition to icons --- src/theme/paths.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/theme/paths.rs b/src/theme/paths.rs index 33f6e24..83008ac 100644 --- a/src/theme/paths.rs +++ b/src/theme/paths.rs @@ -10,7 +10,7 @@ use crate::theme::error::ThemeError; pub(crate) static BASE_PATHS: Lazy> = Lazy::new(icon_theme_base_paths); -/// Look in $HOME/.icons (for backwards compatibility), in $XDG_DATA_DIRS/icons and in /usr/share/pixmaps (in that order). +/// Look in $HOME/.icons (for backwards compatibility), in $XDG_DATA_DIRS/icons, in $XDG_DATA_DIRS/pixmaps and in /usr/share/pixmaps (in that order). /// Paths that are not found are filtered out. fn icon_theme_base_paths() -> Vec { let home_icon_dir = home_dir().expect("No $HOME directory").join(".icons"); @@ -19,9 +19,11 @@ fn icon_theme_base_paths() -> Vec { let mut data_dirs: Vec<_> = bd .get_data_dirs() .into_iter() - .map(|p| p.join("icons")) + .flat_map(|p| [p.join("icons"), p.join("pixmaps")]) .collect(); - data_dirs.push(bd.get_data_home().join("icons")); + let data_home = bd.get_data_home(); + data_dirs.push(data_home.join("icons")); + data_dirs.push(data_home.join("pixmaps")); data_dirs }) .unwrap_or_default();