Initial implementation of breadpaper
CLI tool that sets a wallpaper with awww, generates a pywal colour palette, and reloads bread-theme to recolour all running bread GTK apps. Includes CI workflows, bakery metadata, and Arch PKGBUILD.
This commit is contained in:
commit
a8b38597ff
14 changed files with 548 additions and 0 deletions
36
src/main.rs
Normal file
36
src/main.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
use std::path::PathBuf;
|
||||
use std::process;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "breadpaper", about = "Wallpaper manager for the bread desktop")]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Command,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Command {
|
||||
/// Set wallpaper, generate pywal palette, and reload bread themes
|
||||
Set {
|
||||
/// Path to the image file
|
||||
path: PathBuf,
|
||||
},
|
||||
/// Print the current wallpaper path
|
||||
Get,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
|
||||
let result = match cli.command {
|
||||
Command::Set { path } => breadpaper::set(&path),
|
||||
Command::Get => breadpaper::get().map(|p| println!("{}", p.display())),
|
||||
};
|
||||
|
||||
if let Err(e) = result {
|
||||
eprintln!("error: {e:#}");
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue