files: if folder name longer than 7 characters, truncate

Signed-off-by: Miles Alan <m@milesalan.com>
This commit is contained in:
Anjandev Momi 2020-07-08 14:57:12 -07:00 committed by Miles Alan
parent a245f46914
commit 0013ea3d73

View file

@ -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