mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
21 lines
522 B
Rust
21 lines
522 B
Rust
use crate::{Yazi, keymap::Keymap, theme::Theme};
|
|
|
|
pub(crate) struct Preset;
|
|
|
|
impl Preset {
|
|
pub(super) fn yazi() -> Result<Yazi, toml::de::Error> {
|
|
toml::from_str(&yazi_macro::config_preset!("yazi"))
|
|
}
|
|
|
|
pub(super) fn keymap() -> Result<Keymap, toml::de::Error> {
|
|
toml::from_str(&yazi_macro::config_preset!("keymap"))
|
|
}
|
|
|
|
pub(super) fn theme(light: bool) -> Result<Theme, toml::de::Error> {
|
|
toml::from_str(&if light {
|
|
yazi_macro::theme_preset!("light")
|
|
} else {
|
|
yazi_macro::theme_preset!("dark")
|
|
})
|
|
}
|
|
}
|