disable then enable

This commit is contained in:
2023-09-22 18:57:34 -04:00
parent 5c1889ef7d
commit 19d0f8be6a

View File

@@ -74,21 +74,18 @@ fn main() {
} }
} }
// TODO do all enables then all disables. // TODO if there are no enables do nothing.
// TODO if there are only disables then do nothing. outputs.iter()
for output in &outputs { .for_each(|output| {
match output { if let SwayOutput::Disabled{name} = output {
SwayOutput::Disabled { name } => {
println!("swaymsg output {} disabled", name); 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);
}
});
} }