format update

This commit is contained in:
David Schroeder
2026-09-22 23:11:12 -05:00
parent 6ceb98e831
commit be3c22ac28
3 changed files with 23 additions and 6 deletions
+18
View File
@@ -38,6 +38,24 @@ TAPM_UI_RULE() {
TAPM_UI_TEXT "$TAPM_UI_MUTED" "${rule// /-}"
}
TAPM_UI_SHORTCUTS() {
local key description length used=0 gap=''
printf ' '
while (( $# >= 2 )); do
key="$1" description="$2"
shift 2
length=$((${#key} + 1 + ${#description}))
if (( used > 0 && used + 3 + length > TAPM_UI_WIDTH - 2 )); then
printf '\n '
used=0 gap=''
fi
printf '%s%s%s%s %s' "$gap" "$TAPM_UI_ACCENT" "$key" "$TAPM_UI_RESET" "$description"
used=$((used + ${#gap} + length))
gap=' '
done
printf '\n'
}
TAPM_UI_TASK() {
TAPM_UI_TEXT "$TAPM_UI_ACCENT" "Starting: $(TAPM_UI_PLAIN "$1")"
TAPM_UI_RULE