beer: initial project scaffolding

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I07c4ee715f51332893e2466b8c52f8eb6a6a6964
This commit is contained in:
raf 2026-06-20 12:50:48 +03:00
commit 35ea435776
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
4 changed files with 99 additions and 13 deletions

49
Cargo.lock generated
View file

@ -17,6 +17,16 @@ version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
[[package]]
name = "beer"
version = "0.0.0"
dependencies = [
"anyhow",
"pound",
"tracing",
"tracing-subscriber",
]
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.4" version = "1.0.4"
@ -71,6 +81,26 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "pound"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b29188deca8885da40aaafd27d756c5d94420fb8ba8a569663c7a87fef6d28ad"
dependencies = [
"pound-derive",
]
[[package]]
name = "pound-derive"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "215966bbf23c9af48d9014a71bc426ecf9be95ffb04b5f1ae3e64f8d8a2a920c"
dependencies = [
"proc-macro2",
"quote",
"venial",
]
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.106" version = "1.0.106"
@ -214,6 +244,16 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "venial"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a42528baceab6c7784446df2a10f4185078c39bf73dc614f154353f1a6b1229"
dependencies = [
"proc-macro2",
"quote",
]
[[package]] [[package]]
name = "windows-link" name = "windows-link"
version = "0.2.1" version = "0.2.1"
@ -228,12 +268,3 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [ dependencies = [
"windows-link", "windows-link",
] ]
[[package]]
name = "wterm"
version = "0.0.0"
dependencies = [
"anyhow",
"tracing",
"tracing-subscriber",
]

View file

@ -1,20 +1,19 @@
[package] [package]
name = "wterm" name = "beer"
version = "0.0.0" version = "0.0.0"
edition = "2024" edition = "2024"
rust-version = "1.95" rust-version = "1.95.0"
description = "A fast, software-rendered, Wayland-native terminal emulator" description = "A fast, software-rendered, Wayland-native terminal emulator"
license = "EUPL-1.2" license = "EUPL-1.2"
readme = true readme = true
default-run = "wterm"
[dependencies] [dependencies]
anyhow = "1.0.102" anyhow = "1.0.102"
pound = "0.1.6"
tracing = "0.1.44" tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
[lints.rust] [lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
unsafe_op_in_unsafe_fn = "deny" unsafe_op_in_unsafe_fn = "deny"
missing_debug_implementations = "warn" missing_debug_implementations = "warn"

49
src/main.rs Normal file
View file

@ -0,0 +1,49 @@
//! beer, a fast, software-rendered, Wayland-native terminal emulator.
use std::process::ExitCode;
use pound::Parse;
/// A fast, software-rendered, Wayland-native terminal emulator.
#[derive(Parse)]
#[pound(name = "beer", version = "0.0.0")]
struct Cli {
/// Run as a daemon hosting multiple windows.
#[pound(long)]
server: bool,
}
fn main() -> ExitCode {
init_logging();
match run(Cli::parse()) {
Ok(()) => ExitCode::SUCCESS,
Err(err) => {
tracing::error!("{err:#}");
eprintln!("beer: {err:#}");
ExitCode::FAILURE
}
}
}
fn init_logging() {
use tracing_subscriber::{EnvFilter, fmt};
let filter = EnvFilter::try_from_env("BEER_LOG")
.or_else(|_| EnvFilter::try_from_default_env())
.unwrap_or_else(|_| EnvFilter::new("warn"));
fmt()
.with_env_filter(filter)
.with_writer(std::io::stderr)
.init();
}
fn run(cli: Cli) -> anyhow::Result<()> {
if cli.server {
tracing::info!("starting beer server");
todo!("server mode")
}
tracing::info!("starting beer");
todo!("window mode")
}

7
terminfo/beer.info Normal file
View file

@ -0,0 +1,7 @@
# beer terminfo entry. Inherits xterm-256color; only the deltas live here.
#
# Compile with extended (user-defined) capabilities:
# tic -x -o "$out" terminfo/beer.info
beer|beer-256color|beer terminal emulator,
Tc,
use=xterm-256color,