From 921efeb8d26b235c9cc7f857e31d07dbea2c319b Mon Sep 17 00:00:00 2001 From: damage Date: Sat, 13 Jul 2024 20:21:33 +0200 Subject: [PATCH] added relative path into title of dialog --- s3h.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/s3h.sh b/s3h.sh index 67969bc..371b6b4 100755 --- a/s3h.sh +++ b/s3h.sh @@ -45,6 +45,10 @@ while [[ -z "$configFile" ]]; do dir="$START_DIR" fi + # relative path to START_DIR + # XXX: can be done in bash itself? + relPath=$(echo ${dir} |sed "s;^${START_DIR};;g") + # add parent selector if not already in $START_DIR if [[ "$START_DIR" == "$dir" ]]; then para=() @@ -82,7 +86,7 @@ while [[ -z "$configFile" ]]; do if [[ ! -z "$preselect" ]]; then dialogOptions="$dialogOptions --default-item $preselect" fi - ret=$("$DIALOG" --no-tags --stdout $dialogOptions --menu "select connection" 0 0 0 ${para[@]} 2>&1) + ret=$("$DIALOG" --title "${relPath}" --no-tags --stdout $dialogOptions --menu "select connection" 0 0 0 ${para[@]} 2>&1) if [[ $? -ne 0 ]]; then clear exit 1