Compare commits
No commits in common. "f230dcd7017bac6d5db2d1c10a2b2af0c3440059" and "61e9f4d9b576e293b75a4f50d3d4c5deac14ee98" have entirely different histories.
f230dcd701
...
61e9f4d9b5
27
src/lib.rs
27
src/lib.rs
@ -1,11 +1,9 @@
|
|||||||
use std::{
|
use std::collections::HashMap;
|
||||||
collections::HashMap,
|
use std::fmt;
|
||||||
fmt,
|
use std::fs::File;
|
||||||
fs::File,
|
use std::io::{self, BufRead, BufReader};
|
||||||
io::{self, BufRead, BufReader},
|
use std::path::Path;
|
||||||
path::Path,
|
use std::process::{Command, Output};
|
||||||
process::{Command, Output},
|
|
||||||
};
|
|
||||||
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
@ -92,7 +90,7 @@ impl Screen {
|
|||||||
fn metamode(&self, map: &ScreenMapping) -> Result<String, CommandError> {
|
fn metamode(&self, map: &ScreenMapping) -> Result<String, CommandError> {
|
||||||
let Resolution { width, height } = self.resolution;
|
let Resolution { width, height } = self.resolution;
|
||||||
let Offset { x, y } = self.offset;
|
let Offset { x, y } = self.offset;
|
||||||
let (_in_w, _in_h) = match self.orientation {
|
let (in_w, in_h) = match self.orientation {
|
||||||
Orientation::None | Orientation::Invert => (width, height),
|
Orientation::None | Orientation::Invert => (width, height),
|
||||||
Orientation::Right | Orientation::Left => (height, width),
|
Orientation::Right | Orientation::Left => (height, width),
|
||||||
};
|
};
|
||||||
@ -108,16 +106,6 @@ impl Screen {
|
|||||||
None => return Err(CommandError::MissingMonitor(self.name.to_string())),
|
None => return Err(CommandError::MissingMonitor(self.name.to_string())),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(format!(
|
|
||||||
"{connection}: {w}x{h} {x:+}{y:+} {{ForceCompositionPipeline=On, Rotation={rotation}}}",
|
|
||||||
connection = connection,
|
|
||||||
w = width,
|
|
||||||
h = height,
|
|
||||||
x = x,
|
|
||||||
y = y,
|
|
||||||
rotation = rotation,
|
|
||||||
))
|
|
||||||
/*
|
|
||||||
Ok(format!("{connection}: {w}x{h} @{in_w}x{in_h} {x:+}{y:+} {{ForceCompositionPipeline=On, ViewPortIn={in_w}x{in_h}, ViewPortOut={w}x{h}+0+0, Rotation={rotation}}}",
|
Ok(format!("{connection}: {w}x{h} @{in_w}x{in_h} {x:+}{y:+} {{ForceCompositionPipeline=On, ViewPortIn={in_w}x{in_h}, ViewPortOut={w}x{h}+0+0, Rotation={rotation}}}",
|
||||||
connection=connection,
|
connection=connection,
|
||||||
w=width,
|
w=width,
|
||||||
@ -128,7 +116,6 @@ impl Screen {
|
|||||||
y=y,
|
y=y,
|
||||||
rotation=rotation,
|
rotation=rotation,
|
||||||
))
|
))
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,11 +22,7 @@ fn main() -> Result<()> {
|
|||||||
height: 1440,
|
height: 1440,
|
||||||
},
|
},
|
||||||
offset: Offset {
|
offset: Offset {
|
||||||
// The '1 +' here creates a gap between the top monitor and side monitor. When all
|
x: dell.resolution.height as isize,
|
||||||
// monitors have a gap, you can move the mouse between any combo. When the top monitor
|
|
||||||
// is flush with the left, the bottom monitor will have a hard edge that prevents the
|
|
||||||
// mouse from moving to the left monitor.
|
|
||||||
x: 1 + dell.resolution.height as isize,
|
|
||||||
y: 0,
|
y: 0,
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@ -38,7 +34,8 @@ fn main() -> Result<()> {
|
|||||||
height: 1440,
|
height: 1440,
|
||||||
},
|
},
|
||||||
offset: Offset {
|
offset: Offset {
|
||||||
x: (dell.resolution.height + (lg.resolution.width - 2560) / 2) as isize,
|
x: dell.resolution.height as isize,
|
||||||
|
//x: (dell.resolution.height + (lg.resolution.width - 2560) / 2) as isize,
|
||||||
y: (lg.resolution.height) as isize,
|
y: (lg.resolution.height) as isize,
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user