From 8e1f0babb8deaa111dac5f267f043c295c3752c7 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:35:41 +0800 Subject: [PATCH 01/12] debug: print git config and env in mirror step --- .forgejo/workflows/mirror.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 01e1dad..6c45f3d 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -12,6 +12,9 @@ jobs: - name: Mirror to GitHub run: | set -euo pipefail + echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" + echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}" + git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites)" git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git git push --prune \ From 4aad0afeac8d0e38c2906ee0c26371bf2a81706c Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:38:34 +0800 Subject: [PATCH 02/12] debug: add git env and system config inspection --- .forgejo/workflows/mirror.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 6c45f3d..53b0502 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -14,7 +14,9 @@ jobs: set -euo pipefail echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}" - git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites)" + env | grep -iE "^GIT" | sort || echo "(no GIT env vars)" + git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites in global gitconfig)" + git config --list --system 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites in system gitconfig)" git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git git push --prune \ From 2d0d9728b26386d2ccb740abc385dbfdc8259e34 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:39:30 +0800 Subject: [PATCH 03/12] debug: inspect workspace git config --- .forgejo/workflows/mirror.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 53b0502..2e8fe90 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -14,9 +14,10 @@ jobs: set -euo pipefail echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}" - env | grep -iE "^GIT" | sort || echo "(no GIT env vars)" - git config --list --global | grep -E "url|insteadOf" || echo "(no url rewrites in global gitconfig)" - git config --list --system 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites in system gitconfig)" + echo "=== workspace git config ===" + cat "${GITHUB_WORKSPACE}/.git/config" 2>/dev/null || echo "(no workspace .git/config)" + echo "=== all git config ===" + git config --list 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites anywhere)" git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git git push --prune \ From 19e660937f2a9a53ab424524389fd4980301c256 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:40:22 +0800 Subject: [PATCH 04/12] debug: GIT_CURL_VERBOSE trace --- .forgejo/workflows/mirror.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 2e8fe90..bdf4f7d 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -14,11 +14,7 @@ jobs: set -euo pipefail echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}" - echo "=== workspace git config ===" - cat "${GITHUB_WORKSPACE}/.git/config" 2>/dev/null || echo "(no workspace .git/config)" - echo "=== all git config ===" - git config --list 2>/dev/null | grep -E "url|insteadOf" || echo "(no url rewrites anywhere)" - git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git + GIT_CURL_VERBOSE=1 git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git 2>&1 | head -40 || true cd repo.git git push --prune \ "https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadpaper.git" \ From 4bb2fd43ca3edc97a9ff23bc20cdbef9625cd7e5 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:45:56 +0800 Subject: [PATCH 05/12] fix: move release workflow to Forgejo, add LICENSE release.yml moves from .github/ to .forgejo/ so it runs directly on the hestia runner without needing the GitHub mirror. GitHub upload step dropped; bakery uses dl.breadway.dev as primary. LICENSE added to fix PKGBUILD package() failure. --- .forgejo/workflows/mirror.yml | 4 +--- {.github => .forgejo}/workflows/release.yml | 16 ---------------- LICENSE | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 19 deletions(-) rename {.github => .forgejo}/workflows/release.yml (70%) create mode 100644 LICENSE diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index bdf4f7d..01e1dad 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -12,9 +12,7 @@ jobs: - name: Mirror to GitHub run: | set -euo pipefail - echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" - echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-unset}" - GIT_CURL_VERBOSE=1 git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git 2>&1 | head -40 || true + git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git git push --prune \ "https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadpaper.git" \ diff --git a/.github/workflows/release.yml b/.forgejo/workflows/release.yml similarity index 70% rename from .github/workflows/release.yml rename to .forgejo/workflows/release.yml index fe0f52d..50a0bd7 100644 --- a/.github/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -4,9 +4,6 @@ on: push: tags: ["v*"] -permissions: - contents: write - env: DL_DIR: /srv/breadway-dl ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem @@ -46,16 +43,3 @@ jobs: - name: regenerate index.json run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" - - - name: upload to GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${GITHUB_REF_NAME#v}" - PKG_DIR="${DL_DIR}/breadpaper/${VERSION}" - gh release create "${GITHUB_REF_NAME}" \ - --title "breadpaper v${VERSION}" --generate-notes 2>/dev/null || true - gh release upload "${GITHUB_REF_NAME}" \ - "${PKG_DIR}/breadpaper-x86_64" \ - "${PKG_DIR}/breadpaper-x86_64.sha256" \ - --clobber diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..373e4ee --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Breadway + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From ca843bf2556c5ac4b7e7b97d47badd4faad51718 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:49:06 +0800 Subject: [PATCH 06/12] fix(ci): replace actions/checkout with manual git clone in release actions/checkout uses GITHUB_SERVER_URL=http://localhost:3002 which is unreachable from inside the Docker container. Use the public Forgejo URL directly, matching the pattern used by package.yml. --- .forgejo/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 50a0bd7..f85b60b 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -12,7 +12,10 @@ jobs: build: runs-on: [self-hosted, hestia] steps: - - uses: actions/checkout@v4 + - name: checkout + run: | + git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" . - name: build run: cargo build --release --locked From 2d0cdae3962e6941e3529dee314c0c0549908811 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 14:54:59 +0800 Subject: [PATCH 07/12] fix(ci): run release job on hestia host to access cargo and dl server hestia-host maps to host execution on the Forgejo runner, giving access to /home/breadway/.cargo/bin/cargo and /srv/breadway-dl without Docker. --- .forgejo/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index f85b60b..c374bf6 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -10,7 +10,7 @@ env: jobs: build: - runs-on: [self-hosted, hestia] + runs-on: hestia-host steps: - name: checkout run: | From 014fd9c12e367df99729683d2256edc607ee36af Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 18:54:32 +0800 Subject: [PATCH 08/12] fix(ci): add cargo to PATH for host runner --- .forgejo/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index c374bf6..384b829 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -7,6 +7,7 @@ on: env: DL_DIR: /srv/breadway-dl ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem + PATH: /home/breadway/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin jobs: build: From b064e86f2f793239b2004c21c4c46809ee347321 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 19:09:15 +0800 Subject: [PATCH 09/12] fix(ci): clone to /tmp to avoid stale work-dir permissions, use hestia label --- .forgejo/workflows/release.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 384b829..cd57261 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -11,18 +11,24 @@ env: jobs: build: - runs-on: hestia-host + runs-on: hestia + defaults: + run: + working-directory: /tmp/breadpaper-build + steps: - name: checkout + working-directory: /tmp run: | + rm -rf /tmp/breadpaper-build git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ - "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" . + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" /tmp/breadpaper-build - name: build - run: cargo build --release --locked + run: /home/breadway/.cargo/bin/cargo build --release --locked - name: test - run: cargo test --release --locked + run: /home/breadway/.cargo/bin/cargo test --release --locked - name: prepare artifacts run: | @@ -37,6 +43,7 @@ jobs: ln -sfn "${VERSION}" "${DL_DIR}/breadpaper/latest" - name: ensure bread-ecosystem + working-directory: /tmp run: | if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then git -C "${ECOSYSTEM_DIR}" pull --ff-only @@ -46,4 +53,5 @@ jobs: fi - name: regenerate index.json + working-directory: /tmp run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" From 5c9efcf316fc1fac08c9290ec165d9b6290146c0 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 22:44:48 +0800 Subject: [PATCH 10/12] fix: correct awww subcommand to img, support bare path arg, add --version --- src/main.rs | 16 ++++++++++------ src/wallpaper.rs | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 38d3fc6..d108e3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,17 +4,19 @@ 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, + #[command(subcommand)] - command: Command, + command: Option, } #[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 @@ -24,9 +26,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 { diff --git a/src/wallpaper.rs b/src/wallpaper.rs index 4655308..f59fae1 100644 --- a/src/wallpaper.rs +++ b/src/wallpaper.rs @@ -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(()) } From 1b4f9c5c044276e86731462fe32d9b33067931d3 Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 17 Jun 2026 22:53:08 +0800 Subject: [PATCH 11/12] fix(ci): clone bread-ecosystem to /tmp to avoid stale permissions --- .forgejo/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index cd57261..ff3f0c2 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -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 From 1671af82ee1065b23ae3030f3969d18cc4c3fa36 Mon Sep 17 00:00:00 2001 From: Breadway Date: Fri, 19 Jun 2026 08:38:41 +0800 Subject: [PATCH 12/12] fix: rustfmt violations --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index d108e3d..7616f31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,11 @@ use std::process; use clap::{Parser, Subcommand}; #[derive(Parser)] -#[command(name = "breadpaper", version, 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, @@ -16,9 +20,7 @@ struct Cli { #[derive(Subcommand)] enum Command { /// Set wallpaper, generate pywal palette, and reload bread themes - Set { - path: PathBuf, - }, + Set { path: PathBuf }, /// Print the current wallpaper path Get, }