|
|
@ -20,6 +20,8 @@ struct Arguments {
|
|
|
|
nitrogen_dioxide: bool,
|
|
|
|
nitrogen_dioxide: bool,
|
|
|
|
#[clap(short, long = "o3", help = "Display ozone O3")]
|
|
|
|
#[clap(short, long = "o3", help = "Display ozone O3")]
|
|
|
|
ozone: bool,
|
|
|
|
ozone: bool,
|
|
|
|
|
|
|
|
#[clap(short, long, help = "Use color formatting tags for lemonbar and polybar")]
|
|
|
|
|
|
|
|
bar: bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(From, Debug)]
|
|
|
|
#[derive(From, Debug)]
|
|
|
@ -113,6 +115,15 @@ fn main() -> Result<(), Error> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
format!("{aqi} AQI")
|
|
|
|
format!("{aqi} AQI")
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
if arguments.bar {
|
|
|
|
|
|
|
|
print!("%{{F#{}}}", match aqi {
|
|
|
|
|
|
|
|
150.. => "b48ead",
|
|
|
|
|
|
|
|
100.. => "bf616a",
|
|
|
|
|
|
|
|
50.. => "d08770",
|
|
|
|
|
|
|
|
20.. => "ebcb8b",
|
|
|
|
|
|
|
|
0.. => "a3be8c",
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
print!("{}", descriptor);
|
|
|
|
print!("{}", descriptor);
|
|
|
|
println!("{} {}",
|
|
|
|
println!("{} {}",
|
|
|
|
match aqi {
|
|
|
|
match aqi {
|
|
|
@ -132,5 +143,8 @@ fn main() -> Result<(), Error> {
|
|
|
|
0.. => display.green(), // Excellent 0-19
|
|
|
|
0.. => display.green(), // Excellent 0-19
|
|
|
|
}.bold()
|
|
|
|
}.bold()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
if arguments.bar {
|
|
|
|
|
|
|
|
print!("%{{F-}}");
|
|
|
|
|
|
|
|
}
|
|
|
|
return Ok(());
|
|
|
|
return Ok(());
|
|
|
|
}
|
|
|
|
}
|
|
|
|