aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 3cfd2e4ee5e436a055eeffb848a106ae3f147ce7 (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
mod config;
mod run;
mod types;
mod utils;
mod blockmanager;

use std::env;
use std::process;

use blockmanager::BlockManager;

use lazy_static::initialize;

#[async_std::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    
    initialize(&config::CONFIG);

    // if X display is not found then exit the program
    if env::var("DISPLAY").is_err() {
        eprintln!("Error: No Display Running!");
        process::exit(1);
    };

    let blocks = BlockManager::new();
    run::run(blocks).await;
    Ok(())
}