2023-08-01 11:06:35 -05:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2023-06-21 18:58:49 -05:00
|
|
|
|
|
|
|
//! A very, VERY WIP Smithay-based Wayland compositor.
|
|
|
|
//!
|
|
|
|
//! Pinnacle is heavily inspired by the [Awesome Window Manager](https://awesomewm.org),
|
|
|
|
//! and this is an attempt to make something akin to it for Wayland.
|
|
|
|
//!
|
2023-06-21 19:08:29 -05:00
|
|
|
//! While Pinnacle is not a library, this documentation serves to guide those who want to
|
2023-06-21 18:58:49 -05:00
|
|
|
//! contribute or learn how building something like this works.
|
|
|
|
|
2023-07-28 14:33:14 -05:00
|
|
|
#![deny(unused_imports)] // gonna force myself to keep stuff clean
|
2023-06-29 17:41:08 -05:00
|
|
|
#![warn(clippy::unwrap_used)]
|
2023-06-29 12:29:00 -05:00
|
|
|
|
2023-06-17 18:55:04 -05:00
|
|
|
mod api;
|
2023-06-11 17:56:34 -05:00
|
|
|
mod backend;
|
|
|
|
mod cursor;
|
2023-06-17 21:02:58 -05:00
|
|
|
mod focus;
|
2023-06-11 17:56:34 -05:00
|
|
|
mod grab;
|
|
|
|
mod handlers;
|
|
|
|
mod input;
|
|
|
|
mod layout;
|
2023-06-25 20:26:52 -05:00
|
|
|
mod output;
|
2023-06-11 17:56:34 -05:00
|
|
|
mod pointer;
|
|
|
|
mod render;
|
|
|
|
mod state;
|
2023-06-30 21:34:07 -05:00
|
|
|
mod tag;
|
2023-06-11 17:56:34 -05:00
|
|
|
mod window;
|
|
|
|
|
|
|
|
use std::error::Error;
|
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
2023-06-15 12:42:34 -05:00
|
|
|
match tracing_subscriber::EnvFilter::try_from_default_env() {
|
|
|
|
Ok(env_filter) => {
|
|
|
|
tracing_subscriber::fmt()
|
|
|
|
.compact()
|
|
|
|
.with_env_filter(env_filter)
|
|
|
|
.init();
|
|
|
|
}
|
|
|
|
Err(_) => {
|
|
|
|
tracing_subscriber::fmt().compact().init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-19 12:42:49 -05:00
|
|
|
let mut args = std::env::args().skip(1);
|
2023-06-19 13:27:54 -05:00
|
|
|
match args.next().as_deref() {
|
|
|
|
Some("--winit") => {
|
|
|
|
tracing::info!("Starting winit backend");
|
|
|
|
crate::backend::winit::run_winit()?;
|
|
|
|
}
|
|
|
|
Some("--udev") => {
|
|
|
|
tracing::info!("Starting udev backend");
|
|
|
|
crate::backend::udev::run_udev()?;
|
|
|
|
}
|
|
|
|
Some(arg) => tracing::error!("Unknown argument {}", arg),
|
|
|
|
None => {
|
|
|
|
println!(
|
2023-06-24 17:39:40 -05:00
|
|
|
"Specify a backend:\n\t--udev to launch Pinnacle in a tty, or\n\t--winit to launch Pinnacle as a window in your graphical environment."
|
2023-06-19 13:27:54 -05:00
|
|
|
);
|
|
|
|
}
|
2023-06-19 12:42:49 -05:00
|
|
|
}
|
|
|
|
|
2023-06-11 17:56:34 -05:00
|
|
|
Ok(())
|
|
|
|
}
|