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