From b0cb21449fefe2af177537ee543c5785dc92fcd2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 22 Sep 2024 15:09:08 +0100 Subject: [PATCH] [file_previewer.sh]: Get terminal dimensions if not provided Increase usability as standalone script, not just in lf --- file_previewer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_previewer.sh b/file_previewer.sh index fa3a501..0aaa8d1 100755 --- a/file_previewer.sh +++ b/file_previewer.sh @@ -4,8 +4,8 @@ preview_image="/tmp/lf_preview_image.png" file=$1 -width=$2 -height=$3 +width="${2:-$(tput cols)}" +height="${3:-$(tput lines)}" x=$4 y=$5