Compare commits

...

3 commits
v0.1.6 ... main

Author SHA1 Message Date
Breadway
1671af82ee fix: rustfmt violations
Some checks failed
Mirror to GitHub / mirror (push) Failing after 2s
2026-06-19 08:38:41 +08:00
Breadway
1b4f9c5c04 fix(ci): clone bread-ecosystem to /tmp to avoid stale permissions
Some checks failed
Mirror to GitHub / mirror (push) Failing after 2s
release / build (push) Successful in 18s
Build and publish package / package (push) Failing after 1m7s
2026-06-17 22:53:08 +08:00
Breadway
5c9efcf316 fix: correct awww subcommand to img, support bare path arg, add --version
Some checks failed
Mirror to GitHub / mirror (push) Failing after 3s
release / build (push) Failing after 10s
Build and publish package / package (push) Failing after 1m19s
2026-06-17 22:44:48 +08:00
3 changed files with 20 additions and 18 deletions

View file

@ -6,7 +6,7 @@ on:
env:
DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem
ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
PATH: /home/breadway/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
jobs:
@ -45,12 +45,8 @@ jobs:
- name: ensure bread-ecosystem
working-directory: /tmp
run: |
if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then
git -C "${ECOSYSTEM_DIR}" pull --ff-only
else
mkdir -p "$(dirname "${ECOSYSTEM_DIR}")"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
fi
rm -rf "${ECOSYSTEM_DIR}"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
- name: regenerate index.json
working-directory: /tmp

View file

@ -4,19 +4,23 @@ use std::process;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "breadpaper", about = "Wallpaper manager for the bread desktop")]
#[command(
name = "breadpaper",
version,
about = "Wallpaper manager for the bread desktop"
)]
struct Cli {
/// Image file to set as wallpaper (shorthand for `set`)
path: Option<PathBuf>,
#[command(subcommand)]
command: Command,
command: Option<Command>,
}
#[derive(Subcommand)]
enum Command {
/// Set wallpaper, generate pywal palette, and reload bread themes
Set {
/// Path to the image file
path: PathBuf,
},
Set { path: PathBuf },
/// Print the current wallpaper path
Get,
}
@ -24,9 +28,11 @@ enum Command {
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())),
let result = match (cli.command, cli.path) {
(Some(Command::Set { path }), _) | (None, Some(path)) => breadpaper::set(&path),
(Some(Command::Get), _) | (None, None) => {
breadpaper::get().map(|p| println!("{}", p.display()))
}
};
if let Err(e) = result {

View file

@ -5,13 +5,13 @@ use anyhow::{Context, Result, bail};
pub fn apply(path: &Path) -> Result<()> {
let status = Command::new("awww")
.arg("set")
.arg("img")
.arg(path)
.status()
.context("failed to run awww — is awww-daemon running?")?;
if !status.success() {
bail!("awww set exited with {}", status);
bail!("awww img exited with {}", status);
}
Ok(())
}