mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-11-22 08:13:59 +00:00
30 lines
781 B
Rust
30 lines
781 B
Rust
use tracing_subscriber::EnvFilter;
|
|
|
|
mod appd_ipc;
|
|
mod backend;
|
|
mod input;
|
|
mod protocols;
|
|
mod session_env;
|
|
mod state;
|
|
mod windows;
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
tracing_subscriber::fmt()
|
|
.with_env_filter(
|
|
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
|
|
)
|
|
.init();
|
|
|
|
let args: Vec<String> = std::env::args().collect();
|
|
let use_winit = args.iter().any(|a| a == "--winit")
|
|
|| std::env::var("DISPLAY").is_ok()
|
|
|| std::env::var("WAYLAND_DISPLAY").is_ok();
|
|
|
|
if use_winit {
|
|
tracing::info!("starting compositor with winit backend");
|
|
backend::winit::run()
|
|
} else {
|
|
tracing::info!("starting compositor with DRM/KMS backend");
|
|
backend::drm::run()
|
|
}
|
|
}
|