diff options
author | mustafa salih <mustafasalih1991@gmail.com> | 2021-01-18 09:42:18 +0300 |
---|---|---|
committer | mustafa salih <mustafasalih1991@gmail.com> | 2021-01-18 09:42:18 +0300 |
commit | 3596f13cc353aac4a675086af05643d2bad91ac1 (patch) | |
tree | cbaf078617eda25bfb90f78f92a6f9a7306ee3de /src/config.rs | |
parent | 4f83d10cf86bcc4c2364e7f5f24be34712242b04 (diff) |
added reading load average
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 5c76c6a..bd6805e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -101,6 +101,11 @@ fn load_defaults() -> Config { enabled: false, delay: 15.0, }, + loadavg: LoadAvg { + icon: String::from(""), + enabled: false, + delay: 60.0, + }, } } @@ -171,6 +176,11 @@ fn parse_config(doc: &yaml::Yaml) -> Config { let spotify_enabled = get_or_set_bool(doc, "spotify", "enable"); let spotify_delay = get_or_set_f64(doc, "spotify", "delay", 10.0); + //Load Avrage values + let loadavg_icon = get_or_set_string(doc, "loadavg", "icon", ""); + let loadavg_enabled = get_or_set_bool(doc, "loadavg", "enable"); + let loadavg_delay = get_or_set_f64(doc, "loadavg", "delay", 60.0); + Config { seperator, time: Time { @@ -229,6 +239,11 @@ fn parse_config(doc: &yaml::Yaml) -> Config { enabled: spotify_enabled, delay: spotify_delay, }, + loadavg: LoadAvg { + icon: loadavg_icon, + enabled: loadavg_enabled, + delay: loadavg_delay, + }, } } |