Compare commits
2 Commits
87859ed835
...
19d0f8be6a
| Author | SHA1 | Date | |
|---|---|---|---|
| 19d0f8be6a | |||
| 5c1889ef7d |
30
src/main.rs
30
src/main.rs
@@ -27,7 +27,6 @@ fn main() {
|
||||
|
||||
let json = json::parse(s).unwrap();
|
||||
|
||||
// TODO I think there is a better alternative syntax to match here.
|
||||
let json_outputs =
|
||||
if let JsonValue::Array(vec) = json {
|
||||
vec
|
||||
@@ -75,21 +74,18 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO do all enables then all disables.
|
||||
// TODO if there are only disables then do nothing.
|
||||
for output in &outputs {
|
||||
match output {
|
||||
SwayOutput::Disabled { name } => {
|
||||
// TODO if there are no enables do nothing.
|
||||
outputs.iter()
|
||||
.for_each(|output| {
|
||||
if let SwayOutput::Disabled{name} = output {
|
||||
println!("swaymsg output {} disabled", name);
|
||||
// TODO run
|
||||
},
|
||||
SwayOutput::Enabled { name, width, height, x, y } => {
|
||||
println!(
|
||||
"swaymsg output {} enable dpms on mode {}x{} pos {} {}",
|
||||
name, width, height, x, y);
|
||||
// TODO run
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
outputs.iter()
|
||||
.for_each(|output| {
|
||||
if let SwayOutput::Enabled{name,width,height,x,y} = output {
|
||||
println!("swaymsg output {} enable dpms on mode {}x{} pos {} {}",
|
||||
name, width, height, x, y);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user