Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
006caf0fd5 | ||
|
|
22a6df17b0 | ||
|
|
eaf3fdc93f | ||
|
|
6385a080f1 | ||
|
|
7ece4fd762 |
9 changed files with 126 additions and 109 deletions
|
|
@ -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/*'
|
||||
|
|
|
|||
59
.forgejo/workflows/release.yml
Normal file
59
.forgejo/workflows/release.yml
Normal file
|
|
@ -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
|
||||
67
.github/workflows/release.yml
vendored
67
.github/workflows/release.yml
vendored
|
|
@ -1,67 +0,0 @@
|
|||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
DL_DIR: /srv/breadway-dl
|
||||
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem
|
||||
|
||||
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: |
|
||||
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
|
||||
|
||||
- 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
|
||||
25
Cargo.lock
generated
25
Cargo.lock
generated
|
|
@ -29,7 +29,7 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
|||
[[package]]
|
||||
name = "bread-theme"
|
||||
version = "0.2.3"
|
||||
source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.8#77417d552130281ff787e07d52541eb25e9d533b"
|
||||
source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.10#17d1bb85801b9a8c195b64c02d288cd662c9c780"
|
||||
dependencies = [
|
||||
"dirs",
|
||||
"gtk4",
|
||||
|
|
@ -39,7 +39,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "breadbox"
|
||||
version = "0.2.4"
|
||||
version = "0.2.7"
|
||||
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",
|
||||
|
|
@ -355,7 +355,7 @@ dependencies = [
|
|||
"gobject-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1256,12 +1256,6 @@ dependencies = [
|
|||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.48.0"
|
||||
|
|
@ -1280,15 +1274,6 @@ dependencies = [
|
|||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.48.5"
|
||||
|
|
|
|||
10
README.md
10
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "breadbox-shared"
|
||||
version = "0.2.4"
|
||||
version = "0.2.6"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "breadbox-sync"
|
||||
version = "0.2.4"
|
||||
version = "0.2.6"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "breadbox"
|
||||
version = "0.2.4"
|
||||
version = "0.2.7"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ name = "breadbox"
|
|||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.8", features = ["gtk"] }
|
||||
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.10", features = ["gtk"] }
|
||||
breadbox-shared = { path = "../breadbox-shared" }
|
||||
gtk4 = { version = "0.11", features = ["v4_12"] }
|
||||
gtk4-layer-shell = "0.8"
|
||||
|
|
|
|||
|
|
@ -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<u32> {
|
||||
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<DesktopEntry>, 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<DesktopEntry>, 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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue