plugins/preview-tui | 13 ++++++++++++- diff --git a/plugins/preview-tui b/plugins/preview-tui index a24ac413a0024c7ec60b7544b0062f6dcf69a815..0010340e540afd9aac05267105e58dc71b265d43 100755 --- a/plugins/preview-tui +++ b/plugins/preview-tui @@ -17,7 +17,7 @@ # - unzip # - tar # - man # - optional: bat for code syntax highlighting -# - optional: kitty terminal or catimg for images +# - optional: kitty terminal, catimg, viu, or ueberzug for images # - optional: scope.sh file viewer from ranger. # To use: # 1. drop scope.sh executable in $PATH @@ -171,6 +171,8 @@ elif exists catimg; then catimg "$1" elif exists viu; then viu -t "$1" + elif exists ueberzug; then + preview_ueberzug "$1" else fifo_pager print_bin_info "$1" fi @@ -191,6 +193,15 @@ else $PAGER "$1" & fi fi +} + +preview_ueberzug() { + height=$(tput lines) + width=$(tput cols) + ueberzug layer --parser json 0< <( + printf '{"action": "add", "identifier": "nnn_ueberzug", "x": 0, "y": 0, "max_width": "%s", "max_height": "%s", "path": "%s"}\n' "$width" "$height" "$1" + read + ) } if [ "$PREVIEW_MODE" ] ; then