From 7ece4fd7626d7c7b880ea2172dd7a3bea27a6c73 Mon Sep 17 00:00:00 2001 From: Breadway Date: Fri, 19 Jun 2026 08:38:38 +0800 Subject: [PATCH 1/3] CI: use /tmp for ecosystem clone, avoid permissions conflict --- .github/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71c0ca3..12f8fac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ permissions: env: DL_DIR: /srv/breadway-dl - ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem + ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci jobs: build: @@ -41,12 +41,8 @@ jobs: - name: ensure bread-ecosystem 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 run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh" From 6385a080f159df60b48740091ddeea0cc4582e50 Mon Sep 17 00:00:00 2001 From: Breadway Date: Fri, 3 Jul 2026 14:10:02 +0800 Subject: [PATCH 2/3] CI: migrate release workflow from GitHub Actions to Forgejo Actions GitHub Actions self-hosted runners need per-repo registration on a personal account; Forgejo Actions' runner already serves every repo with zero setup. Moves release publishing there (dl.breadway.dev stays the primary bakery target; GitHub release upload is kept as the fallback via an explicit token, since Forgejo Actions has no ambient GITHUB_TOKEN) and adds a mirror workflow to keep GitHub in sync automatically. --- .forgejo/workflows/mirror.yml | 2 -- .forgejo/workflows/release.yml | 59 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 63 ---------------------------------- README.md | 10 +++--- 4 files changed, 64 insertions(+), 70 deletions(-) create mode 100644 .forgejo/workflows/release.yml delete mode 100644 .github/workflows/release.yml diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 6f40c04..4c186c9 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -14,8 +14,6 @@ jobs: set -euo pipefail git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git cd repo.git - # Mirror only branches and tags (not refs/pull/*, which GitHub rejects); - # --prune deletes GitHub refs that no longer exist on Forgejo. git push --prune \ "https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadbox.git" \ '+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*' diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..de309ae --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,59 @@ +name: release + +on: + push: + tags: ["v*"] + +jobs: + build: + runs-on: [self-hosted, hestia] + steps: + - name: checkout + run: | + set -euo pipefail + rm -rf src && mkdir src + git clone --branch "${GITHUB_REF_NAME}" --depth 1 \ + "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" src + + - name: build + run: cd src && cargo build --release --locked + + - name: prepare artifacts + run: | + set -euo pipefail + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="/srv/breadway-dl/breadbox/${VERSION}" + mkdir -p "${PKG_DIR}" + for bin in breadbox breadbox-sync; do + cp "src/target/release/${bin}" "${PKG_DIR}/${bin}-x86_64" + strip "${PKG_DIR}/${bin}-x86_64" + sha256sum "${PKG_DIR}/${bin}-x86_64" | awk '{print $1}' \ + > "${PKG_DIR}/${bin}-x86_64.sha256" + done + cp src/packaging/breadbox-sync.service "${PKG_DIR}/" + cp src/config.example.toml "${PKG_DIR}/" + cp src/bakery.toml "${PKG_DIR}/bakery.toml" + ln -sfn "${VERSION}" "/srv/breadway-dl/breadbox/latest" + + - name: regenerate index.json + run: | + set -euo pipefail + rm -rf /tmp/bread-ecosystem-ci + git clone https://git.breadway.dev/Breadway/bread-ecosystem.git /tmp/bread-ecosystem-ci + bash /tmp/bread-ecosystem-ci/scripts/gen-index.sh + + - name: upload to GitHub Release + env: + GH_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }} + run: | + set -euo pipefail + VERSION="${GITHUB_REF_NAME#v}" + PKG_DIR="/srv/breadway-dl/breadbox/${VERSION}" + gh release create "${GITHUB_REF_NAME}" --repo Breadway/breadbox \ + --title "breadbox v${VERSION}" --generate-notes 2>/dev/null || true + gh release upload "${GITHUB_REF_NAME}" --repo Breadway/breadbox \ + "${PKG_DIR}/breadbox-x86_64" \ + "${PKG_DIR}/breadbox-sync-x86_64" \ + "${PKG_DIR}/breadbox-x86_64.sha256" \ + "${PKG_DIR}/breadbox-sync-x86_64.sha256" \ + --clobber diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 12f8fac..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: release - -on: - push: - tags: ["v*"] - -permissions: - contents: write - -env: - DL_DIR: /srv/breadway-dl - ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci - -jobs: - build: - runs-on: [self-hosted, hestia] - steps: - - uses: actions/checkout@v4 - - - name: install build deps - run: sudo apt-get install -y libgtk-4-dev librsvg2-dev libdbus-1-dev pkg-config 2>/dev/null || true - - - name: build - run: cargo build --release --locked - - - name: prepare artifacts - run: | - VERSION="${GITHUB_REF_NAME#v}" - PKG_DIR="${DL_DIR}/breadbox/${VERSION}" - mkdir -p "${PKG_DIR}" - for bin in breadbox breadbox-sync; do - cp "target/release/${bin}" "${PKG_DIR}/${bin}-x86_64" - strip "${PKG_DIR}/${bin}-x86_64" - sha256sum "${PKG_DIR}/${bin}-x86_64" | awk '{print $1}' \ - > "${PKG_DIR}/${bin}-x86_64.sha256" - done - cp packaging/breadbox-sync.service "${PKG_DIR}/" - cp config.example.toml "${PKG_DIR}/" - cp bakery.toml "${PKG_DIR}/bakery.toml" - ln -sfn "${VERSION}" "${DL_DIR}/breadbox/latest" - - - name: ensure bread-ecosystem - run: | - rm -rf "${ECOSYSTEM_DIR}" - git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}" - - - 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}/breadbox/${VERSION}" - gh release create "${GITHUB_REF_NAME}" \ - --title "breadbox v${VERSION}" --generate-notes 2>/dev/null || true - gh release upload "${GITHUB_REF_NAME}" \ - "${PKG_DIR}/breadbox-x86_64" \ - "${PKG_DIR}/breadbox-sync-x86_64" \ - "${PKG_DIR}/breadbox-x86_64.sha256" \ - "${PKG_DIR}/breadbox-sync-x86_64.sha256" \ - --clobber diff --git a/README.md b/README.md index 2b6ce13..b829c6c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ breadbox GTK4 layer-shell launcher - Layer-shell window, centered 600 px wide, keyboard-exclusive - Reads the active Hyprland workspace and sorts apps by context priority -- Fuzzy filtering as you type; Enter launches, Escape closes +- Launch history: non-priority apps sort by most-launched first, then alphabetically +- Fuzzy filtering as you type; Enter or click to launch, Escape or click outside to close - App icons loaded from the resolved icon cache (see `breadbox-sync`) - pywal palette auto-detected from `~/.cache/wal/colors.json`, falls back to Catppuccin Mocha - User CSS override at `~/.config/breadbox/style.css` @@ -88,10 +89,9 @@ breadbox-sync ``` Icon resolution order: -1. System icon theme (`~/.local/share/icons`, `/usr/share/icons`, `/usr/share/pixmaps`) — 64 px > 48 px PNG, then SVG -2. Flathub media server — for reverse-DNS app IDs (e.g. `org.gnome.Gedit`) -3. icon.horse — downloaded and cached -4. `application-x-executable` fallback from system theme +1. System icon theme (`~/.local/share/icons`, `/usr/share/icons`, `/usr/share/pixmaps`) — 64 px > 48 px > 128 px > 32 px > 256 px PNG, then SVG +2. Flathub appstream CDN — for reverse-DNS app IDs (e.g. `org.gnome.Gedit`) +3. `application-x-executable` fallback from system theme ### Systemd service (run on login) From eaf3fdc93f14579adb1374af4cd151c9d97bfeb2 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sun, 5 Jul 2026 09:15:42 +0800 Subject: [PATCH 3/3] 0.2.6: search placeholder text, tighten fuzzy-match noise Search entry's placeholder read "breadbox" -- the app's own name -- easily mistaken for an already-typed query. Now reads "Search apps...". Bare-subsequence matching (e.g. "zen" matching "Avahi Zeroconf Browser" via z...e...n) surfaced alongside real name-based hits like "Zen Browser". The filter now hides subsequence-only rows whenever a stronger, name-based match exists elsewhere in the results -- that kind of noise now only shows up when it's the best any entry can do. Note: bumping to 0.2.6, not 0.2.5 -- Cargo.toml had drifted one release behind the actual latest tag (v0.2.5 already existed). --- Cargo.lock | 6 ++-- breadbox-shared/Cargo.toml | 2 +- breadbox-sync/Cargo.toml | 2 +- breadbox/Cargo.toml | 2 +- breadbox/src/main.rs | 64 +++++++++++++++++++++++++++++++------- 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f3f9c2..a82d64b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "breadbox" -version = "0.2.4" +version = "0.2.6" dependencies = [ "bread-theme", "breadbox-shared", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "breadbox-shared" -version = "0.2.4" +version = "0.2.6" dependencies = [ "serde", "serde_json", @@ -59,7 +59,7 @@ dependencies = [ [[package]] name = "breadbox-sync" -version = "0.2.4" +version = "0.2.6" dependencies = [ "breadbox-shared", "serde_json", diff --git a/breadbox-shared/Cargo.toml b/breadbox-shared/Cargo.toml index ec62ed1..f69d7a1 100644 --- a/breadbox-shared/Cargo.toml +++ b/breadbox-shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-shared" -version = "0.2.4" +version = "0.2.6" edition = "2021" license = "MIT" diff --git a/breadbox-sync/Cargo.toml b/breadbox-sync/Cargo.toml index bdcab16..d85f1dc 100644 --- a/breadbox-sync/Cargo.toml +++ b/breadbox-sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox-sync" -version = "0.2.4" +version = "0.2.6" edition = "2021" license = "MIT" diff --git a/breadbox/Cargo.toml b/breadbox/Cargo.toml index 9189abf..9d3f28b 100644 --- a/breadbox/Cargo.toml +++ b/breadbox/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "breadbox" -version = "0.2.4" +version = "0.2.6" edition = "2021" license = "MIT" diff --git a/breadbox/src/main.rs b/breadbox/src/main.rs index 17f72ac..e5e5840 100644 --- a/breadbox/src/main.rs +++ b/breadbox/src/main.rs @@ -252,6 +252,42 @@ fn fuzzy_score(query: &str, entry: &DesktopEntry) -> u32 { 4 // subsequence match } +/// Same tiers as `fuzzy_score`, but `None` when nothing matches at all +/// (rather than falling through to a bare-subsequence score), and folds in +/// `exec` as a tier-4 (weakest) match too — used for filtering, not sorting. +/// Tier 4 is loose enough that e.g. querying "zen" matches "Avahi Zeroconf +/// Browser" (z…e…n as a subsequence) alongside the real "Zen Browser" hit; +/// the filter hides tier-4-only rows whenever a tier ≤2 (name-based) match +/// exists elsewhere in the list, so that kind of noise only shows up when +/// it's the best any entry can do. +fn match_tier(query: &str, entry: &DesktopEntry) -> Option { + if query.is_empty() { + return Some(0); + } + let q = query.to_lowercase(); + let name = entry.name.to_lowercase(); + let wm = entry.wm_class.as_deref().unwrap_or("").to_lowercase(); + if name == q || wm == q { + return Some(0); + } + if name.starts_with(&q) { + return Some(1); + } + if name.contains(&q) { + return Some(2); + } + if wm.starts_with(&q) || wm.contains(&q) { + return Some(3); + } + if fuzzy_matches(query, &entry.name) + || entry.wm_class.as_deref().is_some_and(|w| fuzzy_matches(query, w)) + || fuzzy_matches(query, &entry.exec) + { + return Some(4); + } + None +} + // ---- PID file toggle -------------------------------------------------------- fn pid_file() -> PathBuf { @@ -344,7 +380,7 @@ fn run_ui(entries: Vec, history: LaunchHistory) { vbox.set_size_request(600, -1); let search = SearchEntry::new(); - search.set_placeholder_text(Some("breadbox")); + search.set_placeholder_text(Some("Search apps…")); vbox.append(&search); let scroll = ScrolledWindow::new(); @@ -425,20 +461,26 @@ fn run_ui(entries: Vec, history: LaunchHistory) { let text = entry.text(); let query = text.as_str(); *filter_query.borrow_mut() = query.to_string(); + + // Two passes: first collect each row's match tier, then decide + // visibility — a tier-4 (bare subsequence) row only gets hidden + // once we know whether some *other* row has a real tier ≤2 hit. + let mut rows = Vec::new(); let mut i = 0i32; while let Some(row) = list_f.row_at_index(i) { - let vis = get_row_entry(&row) - .map(|e| { - fuzzy_matches(query, &e.name) - || e.wm_class - .as_deref() - .is_some_and(|w| fuzzy_matches(query, w)) - || fuzzy_matches(query, &e.exec) - }) - .unwrap_or(false); - row.set_visible(vis); + let tier = get_row_entry(&row).and_then(|e| match_tier(query, &e)); + rows.push((row, tier)); i += 1; } + let has_direct_hit = rows.iter().any(|(_, t)| matches!(t, Some(0..=2))); + for (row, tier) in &rows { + let vis = match tier { + None => false, + Some(4) if has_direct_hit => false, + Some(_) => true, + }; + row.set_visible(vis); + } list_f.invalidate_sort(); let first_vis = (0i32..).find_map(|j| { list_f.row_at_index(j).filter(|r| r.is_visible())