aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorMustafa Salih <37256744+MustafaSalih1993@users.noreply.github.com>2021-01-01 07:21:05 +0300
committerGitHub <noreply@github.com>2021-01-01 07:21:05 +0300
commit2a10378da4097477b66edac08b5a80c6cf1d2567 (patch)
tree04414b286321ddfc7d1e84a3accd551321aefeb0 /src/main.rs
parent2bbf632baa73448f54a6292ab105e60a25cb587f (diff)
parent7f60ba8ea09969411906ca5dbb48b6357596218a (diff)
Merge pull request #10 from MustafaSalih1993/dev
Dev
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs46
1 files changed, 3 insertions, 43 deletions
diff --git a/src/main.rs b/src/main.rs
index c496e6a..2211cb9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,46 +1,6 @@
-use std::process::Command;
-use std::thread;
-use std::time::Duration;
-
-mod date;
-mod disk;
-mod load_config;
-mod mem;
-mod sound;
-
-// TODO: this is sucks, maybe thread, i want to spawn some threads
+use rsblocks;
fn main() {
- let settings = load_config::load().unwrap();
- sound::get_sound(&settings);
- loop {
- let mut bar = String::from("");
-
- // the order of the IF's below matters to the final format
-
- if settings.volume.enabled {
- // volume return String
- bar.push_str(&sound::get_sound(&settings));
- }
-
- if settings.disk.enabled {
- // disk_free return String
- bar.push_str(&disk::disk_free(&settings));
- }
-
- if settings.memory.enabled {
- // mem return Result
- bar.push_str(&mem::mem(&settings).unwrap());
- }
-
- bar.push_str(&date::fmt_date(&settings));
-
- Command::new("xsetroot")
- .arg("-name")
- .arg(bar)
- .output()
- .unwrap();
-
- thread::sleep(Duration::from_millis(75));
- }
+ let config = rsblocks::load_config().unwrap();
+ rsblocks::run(config);
}