fix missing shell expand

This commit is contained in:
LordGrimmauld 2024-04-02 17:19:42 +02:00
parent 2c71f4ad2b
commit 018a98d7bc

View File

@ -185,7 +185,10 @@ impl Args {
xdg::BaseDirectories::with_prefix(XDG_PREFIX) xdg::BaseDirectories::with_prefix(XDG_PREFIX)
.expect("Failed to read xdg base dirs") .expect("Failed to read xdg base dirs")
.find_config_file(name) .find_config_file(name)
}).map(|f| f.to_string_lossy().to_string()); }).map(|f| {
let f = f.to_string_lossy().to_string();
shellexpand::tilde(&f).to_string()
});
} }
/// Load Configuration File /// Load Configuration File
@ -246,15 +249,13 @@ impl Args {
/// Load CSS Theme or Default /// Load CSS Theme or Default
pub fn get_theme(&self) -> String { pub fn get_theme(&self) -> String {
let theme = self.find_xdg_file(DEFAULT_THEME, &self.theme); self.find_xdg_file(DEFAULT_THEME, &self.theme)
.map(read_to_string)
if let Some(path) = theme { .map(|f| f.unwrap_or_else(|err| {
match read_to_string(&path) { log::error!("Failed to load CSS: {err:?}");
Ok(css) => return css, String::new()
Err(err) => log::error!("Failed to load CSS: {err:?}"), }))
} .unwrap_or_else(String::new)
}
String::new()
} }
/// Load Additional CSS or Default /// Load Additional CSS or Default