Upload files to "/"
This commit is contained in:
commit
1dc9787944
9 changed files with 5785 additions and 0 deletions
50
src/cli.rs
Normal file
50
src/cli.rs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//cli.rs
|
||||
use clap::{Parser, ValueEnum};
|
||||
|
||||
#[derive(Debug, Clone, Copy, ValueEnum)]
|
||||
pub enum LinuxBackend {
|
||||
Auto,
|
||||
X11,
|
||||
Wayland,
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
name = "rustywolf",
|
||||
about = "Privacy-focused WebKit browser",
|
||||
long_about = "RustyWolf launches an embedded WebKit browser window.",
|
||||
version
|
||||
)]
|
||||
pub struct Cli {
|
||||
#[arg(long, help = "Optional startup URL (defaults to https://duckduckgo.com)")]
|
||||
pub url: Option<String>,
|
||||
|
||||
#[arg(long, help = "Set a custom window title")]
|
||||
pub title: Option<String>,
|
||||
|
||||
#[arg(long, help = "Try private/incognito mode when backend supports it")]
|
||||
pub private: bool,
|
||||
|
||||
#[arg(long, help = "Print launch settings without opening a window")]
|
||||
pub dry_run: bool,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
value_enum,
|
||||
default_value_t = LinuxBackend::Auto,
|
||||
help = "Linux only: prefer a windowing backend (auto, x11, wayland)"
|
||||
)]
|
||||
pub linux_backend: LinuxBackend,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
help = "Linux only: disable WebKit dmabuf renderer (helps some NVIDIA/Wayland setups)"
|
||||
)]
|
||||
pub linux_disable_dmabuf: bool,
|
||||
}
|
||||
|
||||
impl Cli {
|
||||
pub fn parse_args() -> Self {
|
||||
Self::parse()
|
||||
}
|
||||
}
|
||||
17
src/main.rs
Normal file
17
src/main.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//main.rs
|
||||
mod cli;
|
||||
mod webview;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
fn main() {
|
||||
if let Err(err) = run() {
|
||||
eprintln!("error: {err:#}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
fn run() -> Result<()> {
|
||||
let cli = cli::Cli::parse_args();
|
||||
webview::launch_webkit(&cli)
|
||||
}
|
||||
BIN
src/rustywolf.icns
Normal file
BIN
src/rustywolf.icns
Normal file
Binary file not shown.
BIN
src/rustywolf.ico
Normal file
BIN
src/rustywolf.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
2206
src/webview.rs
Normal file
2206
src/webview.rs
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue