aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormustafa salih <mustafasalih1991@gmail.com>2021-01-16 09:26:06 +0300
committermustafa salih <mustafasalih1991@gmail.com>2021-01-16 09:26:06 +0300
commit4f83d10cf86bcc4c2364e7f5f24be34712242b04 (patch)
tree434dbeded52ced22d6f6f064f7f7f16f7f5bbbf0 /src/main.rs
parent6a349a0e0282e56b03adbe02b41bfaf0cc3213f1 (diff)
added some checks
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 8d986d2..e412025 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,8 +2,15 @@ mod config;
mod run;
mod types;
mod utils;
+use std::env;
+use std::process;
fn main() {
+ // 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 config = config::load_config().unwrap();
let blocks = types::Blocks::new();
run::run(config, blocks);