1mod app;
6mod event;
7mod handlers;
8pub mod hooks;
9pub mod image_loader;
10mod screens;
11mod theme;
12mod ui;
13mod widgets;
14
15pub use app::App;
16
17use crate::config::Config;
18use anyhow::Result;
19use ratatui_image::picker::Picker;
20
21pub fn run(config: Config) -> Result<()> {
23 let picker = if config.album_art_mode.is_off() {
27 None
28 } else {
29 match Picker::from_query_stdio() {
30 Ok(p) => Some(p),
31 Err(e) => {
32 tracing::debug!("Terminal image protocol detection failed: {e}");
33 None
34 }
35 }
36 };
37
38 let theme = theme::Theme::from_name(&config.theme);
39 let app = App::new(config, theme, picker)?;
40 event::run_event_loop(app)
41}