Compare commits
5 Commits
333119a00d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3207b7704b | |||
| 5113e9d7a5 | |||
| 4429b6a6a6 | |||
| 5a416f4552 | |||
| fa892c9650 |
50
src/main.rs
50
src/main.rs
@@ -2,17 +2,28 @@ use anyhow::Result;
|
|||||||
use fixscreen::*;
|
use fixscreen::*;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let dell = Screen {
|
let dell43 = Screen {
|
||||||
name: ("DELL U2415".to_string()),
|
name: ("DELL U4323QE".to_string()),
|
||||||
resolution: Resolution {
|
resolution: Resolution {
|
||||||
width: 1920,
|
width: 3840,
|
||||||
height: 1200,
|
height: 2160,
|
||||||
|
},
|
||||||
|
offset: Offset { x: 2560, y: 0 },
|
||||||
|
//orientation: Orientation::Left,
|
||||||
|
workspaces: vec!["fraud".to_string()],
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let lenovo = Screen {
|
||||||
|
name: ("Lenovo Group Limited P27h-20".to_string()),
|
||||||
|
resolution: Resolution {
|
||||||
|
width: 2560,
|
||||||
|
height: 1440,
|
||||||
},
|
},
|
||||||
offset: Offset {
|
offset: Offset {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 1440 * 2 - 1920,
|
y: ((dell43.resolution.height - 1440) / 2) as isize,
|
||||||
},
|
},
|
||||||
orientation: Orientation::Left,
|
primary: true,
|
||||||
workspaces: vec!["distortion".to_string()],
|
workspaces: vec!["distortion".to_string()],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
@@ -27,32 +38,23 @@ fn main() -> Result<()> {
|
|||||||
// monitors have a gap, you can move the mouse between any combo. When the top monitor
|
// 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
|
// is flush with the left, the bottom monitor will have a hard edge that prevents the
|
||||||
// mouse from moving to the left monitor.
|
// mouse from moving to the left monitor.
|
||||||
x: 1 + dell.resolution.height as isize,
|
x: (lenovo.resolution.width + dell43.resolution.width) as isize,
|
||||||
y: 0,
|
y: ((dell43.resolution.height - 1440) / 2) as isize,
|
||||||
},
|
},
|
||||||
workspaces: vec!["virtue".to_string()],
|
workspaces: vec!["virtue".to_string()],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let lenovo = Screen {
|
let map = screen_mapping_from_xorg_log("/var/log/X.0.log")?;
|
||||||
name: ("Lenovo Group Limited P27h-20".to_string()),
|
let lg_connected = std::env::args().len() > 1;
|
||||||
resolution: Resolution {
|
|
||||||
width: 2560,
|
let mut screens = vec![dell43, lenovo];
|
||||||
height: 1440,
|
if lg_connected {
|
||||||
},
|
screens.push(lg);
|
||||||
offset: Offset {
|
}
|
||||||
x: (dell.resolution.height + (lg.resolution.width - 2560) / 2) as isize,
|
|
||||||
y: (lg.resolution.height) as isize,
|
|
||||||
},
|
|
||||||
primary: true,
|
|
||||||
workspaces: vec!["fraud".to_string(), "twilight".to_string()],
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
let screens = vec![dell, lg, lenovo];
|
|
||||||
let cfg = Config {
|
let cfg = Config {
|
||||||
screens: screens.clone(),
|
screens: screens.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let map = screen_mapping_from_xorg_log("/var/log/X.0.log")?;
|
|
||||||
let cmd = run_cmd(&map, &cfg)?;
|
let cmd = run_cmd(&map, &cfg)?;
|
||||||
println!("cmd {:#?}", cmd);
|
println!("cmd {:#?}", cmd);
|
||||||
// TODO(wathiede): run xrandr --output $DPY --primary
|
// TODO(wathiede): run xrandr --output $DPY --primary
|
||||||
|
|||||||
Reference in New Issue
Block a user