aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 23132017868a7dd2387c307834dfbfab4246bb5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#![allow(unused_must_use)]

mod app;
mod command;
mod habit;
mod theme;
mod utils;
mod views;

use crate::app::App;
use crate::command::{open_command_window, Command};
use crate::utils::{load_configuration_file, AppConfig};

use cursive::crossterm;
use cursive::views::NamedView;
use lazy_static::lazy_static;

lazy_static! {
    pub static ref CONFIGURATION: AppConfig = load_configuration_file();
}

fn main() {
    let mut s = crossterm().unwrap();
    let app = App::load_state();
    s.add_layer(NamedView::new("Main", app));
    s.add_global_callback(':', |s| open_command_window(s));

    s.set_theme(theme::theme_gen());
    s.run();
}