Add touchpad hold-tap tool

This commit is contained in:
ajp_anton
2026-08-30 00:28:02 +00:00
commit 1f0090392d
9 changed files with 963 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail
usage() {
printf 'Usage: GITEA_TOKEN=... %s PATH_TO_RPM FEDORA_RELEASE\n' "$0" >&2
}
if (( $# != 2 )); then
usage
exit 2
fi
rpm_path=$1
fedora_release=$2
if [[ ! -f $rpm_path || $rpm_path != *.rpm ]]; then
printf 'Error: %s is not an RPM file.\n' "$rpm_path" >&2
exit 2
fi
if [[ ! $fedora_release =~ ^[0-9]+$ ]]; then
printf 'Error: Fedora release must be a number, such as 44.\n' >&2
exit 2
fi
if [[ -z ${GITEA_TOKEN:-} ]]; then
printf 'Error: set GITEA_TOKEN to a Gitea access token with package write permission.\n' >&2
exit 2
fi
upload_url="https://git.ajpanton.se/api/packages/ajp_anton/rpm/fedora/${fedora_release}/upload"
curl \
--fail-with-body \
--show-error \
--silent \
--user "ajp_anton:${GITEA_TOKEN}" \
--upload-file "$rpm_path" \
"$upload_url"
printf 'Published %s for Fedora %s.\n' "$rpm_path" "$fedora_release"