aboutsummaryrefslogtreecommitdiff
path: root/src/run.rs
diff options
context:
space:
mode:
authorMustafa Salih <37256744+MustafaSalih1993@users.noreply.github.com>2021-02-15 04:31:29 +0300
committerGitHub <noreply@github.com>2021-02-15 04:31:29 +0300
commitf16724e986b17dd739b086a917672bb36b1d9b16 (patch)
tree508ce31128c5e2c0ea21a50acdf1901c7e0fd428 /src/run.rs
parentc4cd23f471fe8d6fdac7ddca436b477c16031373 (diff)
Dev (#45)
* added bitcoins prices * removed unwanted formating
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/run.rs b/src/run.rs
index 3f7405d..201c337 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -72,6 +72,11 @@ pub fn run(mut blocks: Blocks) {
spawn_thread_loop(tx.clone(), uptime::get_uptime, CONFIG.uptime.delay);
}
+ // BTC thread
+ if CONFIG.bitcoins.enabled {
+ spawn_thread_loop(tx.clone(), bitcoins::get_price, CONFIG.bitcoins.delay);
+ }
+
// net speed thread
// get_netspeed will sleep inside the function
if CONFIG.netspeed.enabled {
@@ -91,7 +96,7 @@ pub fn run(mut blocks: Blocks) {
{
// NOTE: order matters to the final format
- let mut bar: Vec<String> = vec![String::from(""); 13];
+ let mut bar: Vec<String> = vec![String::from(""); 14];
//iterating the values recieved from the threads
for data in rx {
match data {
@@ -100,14 +105,15 @@ pub fn run(mut blocks: Blocks) {
ThreadsData::Sound(x) => bar[2] = x,
ThreadsData::Weather(x) => bar[3] = x,
ThreadsData::NetSpeed(x) => bar[4] = x,
- ThreadsData::PubIp(x) => bar[5] = x,
- ThreadsData::Disk(x) => bar[6] = x,
- ThreadsData::Memory(x) => bar[7] = x,
- ThreadsData::CpuTemp(x) => bar[8] = x,
- ThreadsData::LoadAvg(x) => bar[9] = x,
- ThreadsData::Battery(x) => bar[10] = x,
- ThreadsData::Uptime(x) => bar[11] = x,
- ThreadsData::Time(x) => bar[12] = x,
+ ThreadsData::BitCoins(x) => bar[5] = x,
+ ThreadsData::PubIp(x) => bar[6] = x,
+ ThreadsData::Disk(x) => bar[7] = x,
+ ThreadsData::Memory(x) => bar[8] = x,
+ ThreadsData::CpuTemp(x) => bar[9] = x,
+ ThreadsData::LoadAvg(x) => bar[10] = x,
+ ThreadsData::Battery(x) => bar[11] = x,
+ ThreadsData::Uptime(x) => bar[12] = x,
+ ThreadsData::Time(x) => bar[13] = x,
}
// match ends here