Reorganize file layout

Moves satellite to be the root package, also allowing it to be built
by default.
This commit is contained in:
Shawn Wallace 2024-05-17 23:01:57 -04:00
parent 3afc9ffa9d
commit c1fc38c3d2
14 changed files with 71 additions and 67 deletions

24
src/main.rs Normal file
View file

@ -0,0 +1,24 @@
fn main() {
pretty_env_logger::formatted_timed_builder()
.filter_level(log::LevelFilter::Info)
.parse_default_env()
.init();
xwayland_satellite::main(RealData(get_display()));
}
#[repr(transparent)]
struct RealData(Option<String>);
impl xwayland_satellite::RunData for RealData {
fn display(&self) -> Option<&str> {
self.0.as_deref()
}
}
fn get_display() -> Option<String> {
let mut args: Vec<_> = std::env::args().collect();
if args.len() > 2 {
panic!("Unexpected arguments: {:?}", &args[2..]);
}
(args.len() == 2).then(|| args.swap_remove(1))
}