From f69ba276a8caa01328b8112b8b650211f590a477 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 25 Feb 2026 14:47:27 -0500 Subject: [PATCH] hvk: hvk-select: autocompute width Signed-off-by: Hugo Villeneuve --- scripts/hvk-select.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/hvk-select.sh b/scripts/hvk-select.sh index 2f121bb..7a3327b 100755 --- a/scripts/hvk-select.sh +++ b/scripts/hvk-select.sh @@ -16,12 +16,19 @@ file=() count=0 list="" i=1 +width=0 +prefix_width=15 # Loop over source folder and add files to array while IFS= read -r -d $'\0' file; do f="$(basename ${file})" file+=("${f}") + len=${#f} + if [ "${len}" -gt ${width} ]; then + width="${len}" + fi + status="off" set +e @@ -47,7 +54,7 @@ if [ ${count} -eq 0 ]; then fi rows=$((${count} + 7)) -width=40 +width=$((${prefix_width} + ${width})) dialog --radiolist "HVK board selection" ${rows} ${width} ${count} ${list} 2> ${dialog_outfile} -- 2.47.3