Files
Bendik Aagaard LynghaugandClaude Fable 5.1 8fe75daad6
CI / check (push) Successful in 1m34s
presence: BLE proximity events for a kiosk screen
A swayidle-shaped daemon: `present <cmd>` runs when a Bluetooth LE device
comes within an RSSI threshold, `absent <secs> <cmd>` once nobody has for
that long. Near means 3 of the last 5 advertisements at or above -58 dBm by
default; --calibrate prints the raw stream so the threshold is picked at the
installed screen, not guessed. Nothing is stored: a few seconds of samples in
memory, counted.

Packaged for the [uhhm] registry from the checkout itself, built natively per
arch on tag by Gitea Actions, with the version checked across Cargo.toml,
PKGBUILD and the tag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 21:23:39 +02:00

20 lines
853 B
Bash
Executable File

#!/bin/bash
# publish-registry <dir>: upload every built package in <dir> (debug packages
# skipped) to the [uhhm] Gitea Arch registry. HTTP 409 means that
# pkgver-pkgrel is already published, which is fine on re-runs.
set -euo pipefail
: "${REGISTRY_TOKEN:?}" "${REGISTRY_URL:?}"
shopt -s nullglob
pkgs=("$1"/*.pkg.tar.{zst,xz,gz})
[ ${#pkgs[@]} -gt 0 ] || { echo "no packages in $1" >&2; exit 1; }
for pkg in "${pkgs[@]}"; do
case "$pkg" in *-debug-*) continue ;; esac
code=$(curl -sS -o /tmp/registry-resp -w '%{http_code}' \
--user "bl:$REGISTRY_TOKEN" --upload-file "$pkg" "$REGISTRY_URL")
case "$code" in
2??) echo "uploaded $(basename "$pkg")" ;;
409) echo "already published: $(basename "$pkg")" ;;
*) echo "::error::$(basename "$pkg"): HTTP $code"; cat /tmp/registry-resp; exit 1 ;;
esac
done