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>
This commit is contained in:
co-authored by
Claude Fable 5.1
commit
8fe75daad6
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# check-version [tag-version]: PKGBUILD pkgver, Cargo.toml version and, when
|
||||
# given, the tag must all be the same string. Version lives in Cargo.toml;
|
||||
# PKGBUILD mirrors it so makepkg needs no VCS pkgver().
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
cargo=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||||
pkg=$(sed -n 's/^pkgver=//p' PKGBUILD)
|
||||
[ "$cargo" = "$pkg" ] || { echo "Cargo.toml $cargo != PKGBUILD pkgver $pkg" >&2; exit 1; }
|
||||
if [ $# -gt 0 ]; then
|
||||
[ "$1" = "$cargo" ] || { echo "tag $1 != version $cargo" >&2; exit 1; }
|
||||
fi
|
||||
echo "version $cargo"
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user