Compare commits

..

No commits in common. "3207b7704bd046c2def74bcdb7177a68249393fc" and "5a416f45524b67c49ee5f3b90a8cb7ba0d727bd2" have entirely different histories.

View File

@ -2,29 +2,25 @@ use anyhow::Result;
use fixscreen::*; use fixscreen::*;
fn main() -> Result<()> { fn main() -> Result<()> {
let dell43 = Screen { let dell24 = Screen {
name: ("DELL U4323QE".to_string()), name: ("DELL U2415".to_string()),
resolution: Resolution { resolution: Resolution {
width: 3840, width: 1920,
height: 2160, height: 1200,
}, },
offset: Offset { x: 2560, y: 0 }, offset: Offset { x: 0, y: 950 },
//orientation: Orientation::Left, //orientation: Orientation::Left,
workspaces: vec!["fraud".to_string()], workspaces: vec!["distortion".to_string()],
..Default::default() ..Default::default()
}; };
let lenovo = Screen { let dell30 = Screen {
name: ("Lenovo Group Limited P27h-20".to_string()), name: ("DELL 3007WFP".to_string()),
resolution: Resolution { resolution: Resolution {
width: 2560, width: 2560,
height: 1440, height: 1600,
}, },
offset: Offset { offset: Offset { x: 1920, y: 0 },
x: 0, workspaces: vec!["virtue".to_string()],
y: ((dell43.resolution.height - 1440) / 2) as isize,
},
primary: true,
workspaces: vec!["distortion".to_string()],
..Default::default() ..Default::default()
}; };
let lg = Screen { let lg = Screen {
@ -38,23 +34,29 @@ 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: (lenovo.resolution.width + dell43.resolution.width) as isize, x: 1 + dell24.resolution.height as isize,
y: ((dell43.resolution.height - 1440) / 2) as isize, y: 0,
}, },
workspaces: vec!["virtue".to_string()], workspaces: vec!["twilight".to_string()],
..Default::default() ..Default::default()
}; };
let map = screen_mapping_from_xorg_log("/var/log/X.0.log")?; let lenovo = Screen {
let lg_connected = std::env::args().len() > 1; name: ("Lenovo Group Limited P27h-20".to_string()),
resolution: Resolution {
let mut screens = vec![dell43, lenovo]; width: 2560,
if lg_connected { height: 1440,
screens.push(lg); },
} offset: Offset { x: 1920, y: 1600 },
primary: true,
workspaces: vec!["fraud".to_string()],
..Default::default()
};
let screens = vec![dell24, dell30, 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