rm_config/keymap/
mod.rs

1pub mod actions;
2
3use intuitils::config::{keybindings::KeybindsHolder, IntuiConfig};
4use serde::Deserialize;
5
6use rm_shared::action::Action;
7
8pub use self::actions::{
9    general::GeneralAction, search_tab::SearchAction, torrents_tab::TorrentsAction,
10};
11
12#[derive(Deserialize, Clone)]
13pub struct KeymapConfig {
14    pub general: KeybindsHolder<GeneralAction, Action>,
15    pub torrents_tab: KeybindsHolder<TorrentsAction, Action>,
16    pub search_tab: KeybindsHolder<SearchAction, Action>,
17}
18
19impl IntuiConfig for KeymapConfig {
20    fn app_name() -> &'static str {
21        "rustmission"
22    }
23
24    fn filename() -> &'static str {
25        "keymap.toml"
26    }
27
28    fn default_config() -> &'static str {
29        include_str!("../../defaults/keymap.toml")
30    }
31
32    fn should_exit_if_not_found() -> bool {
33        false
34    }
35
36    fn message_if_not_found() -> Option<String> {
37        None
38    }
39}