From 0013ea3d73c9db003edd5b8c0298c4773b08cfcb Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Wed, 8 Jul 2020 14:57:12 -0700 Subject: [PATCH] files: if folder name longer than 7 characters, truncate Signed-off-by: Miles Alan --- scripts/appscripts/sxmo_files.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/appscripts/sxmo_files.sh b/scripts/appscripts/sxmo_files.sh index d4f426a..b248cc1 100755 --- a/scripts/appscripts/sxmo_files.sh +++ b/scripts/appscripts/sxmo_files.sh @@ -20,6 +20,12 @@ handlefiles() { while true; do CHOICES="$(printf %b 'Close Menu\n../\n*\n'"$(ls -1p)")" DIR="$(basename "$(pwd)")" + TRUNCATED="$(printf %.7s "$DIR")" + if [ "$DIR" != "$TRUNCATED" ]; then + DIR="$TRUNCATED..." + fi + + PICKED="$( echo "$CHOICES" | dmenu -fn Terminus-18 -c -p "$DIR" -l 20