Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ece4fd762 | ||
|
|
a33e979e5e | ||
|
|
83b9fd908e | ||
|
|
8c64ec1bf2 | ||
|
|
732c3126ae | ||
|
|
d464689a18 | ||
|
|
a6007e9a6a | ||
|
|
21392645cd | ||
|
|
b80e06b253 | ||
|
|
8bc185f40c | ||
|
|
cbb1cf03d6 | ||
|
|
43df888aa1 | ||
|
|
f93596adf2 |
9 changed files with 138 additions and 43 deletions
21
.forgejo/workflows/mirror.yml
Normal file
21
.forgejo/workflows/mirror.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
name: Mirror to GitHub
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['**']
|
||||||
|
tags: ['**']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: [self-hosted, hestia]
|
||||||
|
steps:
|
||||||
|
- name: Mirror to GitHub
|
||||||
|
run: |
|
||||||
|
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/*'
|
||||||
40
.forgejo/workflows/package.yml
Normal file
40
.forgejo/workflows/package.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
name: Build and publish package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
runs-on: [self-hosted, hestia]
|
||||||
|
container:
|
||||||
|
image: archlinux:latest
|
||||||
|
steps:
|
||||||
|
# Note: no actions/checkout — the archlinux image has no Node, which JS
|
||||||
|
# actions require. Everything runs as shell steps and clones manually.
|
||||||
|
- name: Build and publish
|
||||||
|
env:
|
||||||
|
PUBLISH_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
VERSION="${GITHUB_REF_NAME#v}"
|
||||||
|
pacman -Syu --noconfirm base-devel git rust cargo gtk4 gtk4-layer-shell librsvg
|
||||||
|
useradd -m builder
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git clone --branch "${GITHUB_REF_NAME}" --depth 1 \
|
||||||
|
"https://git.breadway.dev/${GITHUB_REPOSITORY}.git" /home/builder/src
|
||||||
|
cd /home/builder/src
|
||||||
|
git archive --format=tar.gz --prefix="breadbox-${VERSION}/" HEAD \
|
||||||
|
> packaging/arch/breadbox-${VERSION}.tar.gz
|
||||||
|
SHA=$(sha256sum packaging/arch/breadbox-${VERSION}.tar.gz | awk '{print $1}')
|
||||||
|
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" packaging/arch/PKGBUILD
|
||||||
|
sed -i "s/^sha256sums=.*/sha256sums=('${SHA}')/" packaging/arch/PKGBUILD
|
||||||
|
chown -R builder:builder /home/builder/src
|
||||||
|
# --nocheck: packaging builds the artifact; tests belong in a CI job.
|
||||||
|
su builder -c "cd /home/builder/src/packaging/arch && makepkg -f --noconfirm --nocheck"
|
||||||
|
PKG=$(find /home/builder/src/packaging/arch -name '*.pkg.tar.zst' | head -1)
|
||||||
|
curl -fsS -X PUT \
|
||||||
|
-H "Authorization: token ${PUBLISH_TOKEN}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@${PKG}" \
|
||||||
|
"https://git.breadway.dev/api/packages/Breadway/arch/os"
|
||||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -9,7 +9,7 @@ permissions:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DL_DIR: /srv/breadway-dl
|
DL_DIR: /srv/breadway-dl
|
||||||
ECOSYSTEM_DIR: /home/breadway/Projects/bread-ecosystem
|
ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -41,12 +41,8 @@ jobs:
|
||||||
|
|
||||||
- name: ensure bread-ecosystem
|
- name: ensure bread-ecosystem
|
||||||
run: |
|
run: |
|
||||||
if [[ -d "${ECOSYSTEM_DIR}/.git" ]]; then
|
rm -rf "${ECOSYSTEM_DIR}"
|
||||||
git -C "${ECOSYSTEM_DIR}" pull --ff-only
|
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
|
||||||
else
|
|
||||||
mkdir -p "$(dirname "${ECOSYSTEM_DIR}")"
|
|
||||||
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: regenerate index.json
|
- name: regenerate index.json
|
||||||
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"
|
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"
|
||||||
|
|
|
||||||
10
Cargo.lock
generated
10
Cargo.lock
generated
|
|
@ -28,8 +28,8 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bread-theme"
|
name = "bread-theme"
|
||||||
version = "0.1.0"
|
version = "0.2.3"
|
||||||
source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.1.0#6b5f4f475f66a645b08cb865e6dda8228d23679b"
|
source = "git+https://github.com/Breadway/bread-ecosystem?tag=v0.2.8#77417d552130281ff787e07d52541eb25e9d533b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dirs",
|
"dirs",
|
||||||
"gtk4",
|
"gtk4",
|
||||||
|
|
@ -39,7 +39,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breadbox"
|
name = "breadbox"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bread-theme",
|
"bread-theme",
|
||||||
"breadbox-shared",
|
"breadbox-shared",
|
||||||
|
|
@ -50,7 +50,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breadbox-shared"
|
name = "breadbox-shared"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
@ -59,7 +59,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breadbox-sync"
|
name = "breadbox-sync"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"breadbox-shared",
|
"breadbox-shared",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "breadbox-shared"
|
name = "breadbox-shared"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "breadbox-sync"
|
name = "breadbox-sync"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "breadbox"
|
name = "breadbox"
|
||||||
version = "0.2.1"
|
version = "0.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ name = "breadbox"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.1.0", features = ["gtk"] }
|
bread-theme = { git = "https://github.com/Breadway/bread-ecosystem", tag = "v0.2.8", features = ["gtk"] }
|
||||||
breadbox-shared = { path = "../breadbox-shared" }
|
breadbox-shared = { path = "../breadbox-shared" }
|
||||||
gtk4 = { version = "0.11", features = ["v4_12"] }
|
gtk4 = { version = "0.11", features = ["v4_12"] }
|
||||||
gtk4-layer-shell = "0.8"
|
gtk4-layer-shell = "0.8"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use bread_theme::{hex_to_rgba, load_palette, Palette};
|
use bread_theme::{hex_to_rgba, ink_on, load_palette, Palette};
|
||||||
use std::{
|
use std::{
|
||||||
cell::RefCell,
|
cell::RefCell,
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
|
|
@ -15,7 +15,6 @@ use breadbox_shared::{
|
||||||
config_dir, load_all_desktop_entries, Config, DesktopEntry, IconCache, LaunchHistory,
|
config_dir, load_all_desktop_entries, Config, DesktopEntry, IconCache, LaunchHistory,
|
||||||
};
|
};
|
||||||
use gtk4::{
|
use gtk4::{
|
||||||
gdk::Display,
|
|
||||||
glib,
|
glib,
|
||||||
pango::EllipsizeMode,
|
pango::EllipsizeMode,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
|
@ -133,26 +132,32 @@ fn matches_term(field: &str, term: &str) -> bool {
|
||||||
|
|
||||||
fn build_css(p: &Palette) -> String {
|
fn build_css(p: &Palette) -> String {
|
||||||
let bg_panel = hex_to_rgba(&p.background, 0.60);
|
let bg_panel = hex_to_rgba(&p.background, 0.60);
|
||||||
|
// breadbox-specific rules only — fonts, palette, and generic widgets come
|
||||||
|
// from the shared ecosystem stylesheet (applied first in connect_activate).
|
||||||
|
// Colour is set on each surface (panel, search box, hovered/selected row) so
|
||||||
|
// child labels inherit the legible ink for that background. `on_*` are
|
||||||
|
// luminance-picked black/white — the pywal hues are untouched. Without this a
|
||||||
|
// light `surface` slot makes the selected row's text vanish.
|
||||||
format!(
|
format!(
|
||||||
"* {{ font-family: 'Varela Round', sans-serif; font-size: 14px; }}\
|
"window {{ background-color: transparent; }}\
|
||||||
window {{ background-color: transparent; }}\
|
.launcher-bg {{ background-color: {bg_panel}; color: {on_bg}; border-radius: 8px;\
|
||||||
.launcher-bg {{ background-color: {bg_panel}; border-radius: 8px;\
|
|
||||||
box-shadow: 0 8px 32px rgba(0,0,0,0.6); }}\
|
box-shadow: 0 8px 32px rgba(0,0,0,0.6); }}\
|
||||||
searchentry {{ background-color: {surface}; color: {fg}; caret-color: {accent};\
|
searchentry {{ background-color: {surface}; color: {on_surface}; caret-color: {accent};\
|
||||||
border: none; outline: none; box-shadow: none;\
|
border: none; outline: none; box-shadow: none;\
|
||||||
padding: 12px 16px; border-radius: 6px 6px 0 0; }}\
|
padding: 12px 16px; border-radius: 6px 6px 0 0; }}\
|
||||||
listbox {{ background-color: transparent; padding: 4px; }}\
|
listbox {{ background-color: transparent; padding: 4px; }}\
|
||||||
row {{ padding: 8px 12px; color: {fg}; background-color: transparent;\
|
row {{ padding: 8px 12px; color: {on_bg}; background-color: transparent;\
|
||||||
border-radius: 6px; }}\
|
border-radius: 6px; }}\
|
||||||
row:hover {{ background-color: {surface}; }}\
|
row:hover {{ background-color: {surface}; color: {on_surface}; }}\
|
||||||
row:selected {{ background-color: {surface}; }}\
|
row:selected {{ background-color: {surface}; color: {on_surface}; }}\
|
||||||
.app-name {{ font-size: 14px; }}\
|
.app-name {{ font-size: 14px; }}\
|
||||||
.app-muted {{ color: {fg}; opacity: 0.6; font-size: 12px; }}\
|
.app-muted {{ opacity: 0.6; font-size: 12px; }}\
|
||||||
image {{ margin-right: 8px; }}",
|
image {{ margin-right: 8px; }}",
|
||||||
bg_panel = bg_panel,
|
bg_panel = bg_panel,
|
||||||
surface = p.color0,
|
surface = p.color0,
|
||||||
fg = p.foreground,
|
accent = p.color4,
|
||||||
accent = p.color4,
|
on_bg = ink_on(&p.background),
|
||||||
|
on_surface = ink_on(&p.color0),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,7 +295,7 @@ fn get_row_entry(row: >k4::ListBoxRow) -> Option<DesktopEntry> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_ui(entries: Vec<DesktopEntry>, css: String, history: LaunchHistory) {
|
fn run_ui(entries: Vec<DesktopEntry>, history: LaunchHistory) {
|
||||||
let app = Application::builder()
|
let app = Application::builder()
|
||||||
.application_id("com.breadway.breadbox")
|
.application_id("com.breadway.breadbox")
|
||||||
.build();
|
.build();
|
||||||
|
|
@ -299,14 +304,11 @@ fn run_ui(entries: Vec<DesktopEntry>, css: String, history: LaunchHistory) {
|
||||||
let query_rc: Rc<RefCell<String>> = Rc::new(RefCell::new(String::new()));
|
let query_rc: Rc<RefCell<String>> = Rc::new(RefCell::new(String::new()));
|
||||||
|
|
||||||
app.connect_activate(move |app| {
|
app.connect_activate(move |app| {
|
||||||
// Base CSS
|
// Shared ecosystem base (fonts, palette, generic widgets) first, then
|
||||||
let provider = CssProvider::new();
|
// breadbox-specific CSS layered on top — both hot-reload on
|
||||||
provider.load_from_string(&css);
|
// `bread-theme reload` (the closure re-reads the pywal palette).
|
||||||
gtk4::style_context_add_provider_for_display(
|
bread_theme::gtk::apply_shared();
|
||||||
&Display::default().expect("no display"),
|
bread_theme::gtk::apply_app_css(|| build_css(&load_palette()));
|
||||||
&provider,
|
|
||||||
gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
|
||||||
);
|
|
||||||
|
|
||||||
// User CSS override
|
// User CSS override
|
||||||
{
|
{
|
||||||
|
|
@ -562,8 +564,5 @@ fn main() {
|
||||||
let manifest = load_manifest();
|
let manifest = load_manifest();
|
||||||
let entries = load_sorted_entries(&manifest, &priority, &history);
|
let entries = load_sorted_entries(&manifest, &priority, &history);
|
||||||
|
|
||||||
let palette = load_palette();
|
run_ui(entries, history);
|
||||||
let css = build_css(&palette);
|
|
||||||
|
|
||||||
run_ui(entries, css, history);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
39
packaging/arch/PKGBUILD
Normal file
39
packaging/arch/PKGBUILD
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Maintainer: Breadway <rileyhorsham@gmail.com>
|
||||||
|
|
||||||
|
pkgname=breadbox
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="App launcher for Hyprland / Wayland"
|
||||||
|
arch=('x86_64')
|
||||||
|
url="https://github.com/Breadway/breadbox"
|
||||||
|
license=('MIT')
|
||||||
|
# Some Rust deps (ring/mlua) build vendored C/asm into static archives; makepkg's
|
||||||
|
# default -flto=auto emits GCC LTO bitcode the Rust (lld) link cannot read,
|
||||||
|
# causing undefined-symbol errors. Disable LTO.
|
||||||
|
options=(!lto !debug)
|
||||||
|
depends=('gtk4' 'gtk4-layer-shell' 'librsvg')
|
||||||
|
optdepends=(
|
||||||
|
'hyprland: window and workspace integration'
|
||||||
|
)
|
||||||
|
makedepends=('rust' 'cargo')
|
||||||
|
source=("${pkgname}-${pkgver}.tar.gz")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
cargo build --release --locked
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
cargo test --release --locked --workspace
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
install -Dm755 target/release/breadbox "${pkgdir}/usr/bin/breadbox"
|
||||||
|
install -Dm755 target/release/breadbox-sync "${pkgdir}/usr/bin/breadbox-sync"
|
||||||
|
install -Dm644 packaging/breadbox-sync.service \
|
||||||
|
"${pkgdir}/usr/lib/systemd/user/breadbox-sync.service"
|
||||||
|
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue