Pārlūkot izejas kodu

Merge pull request #851 from Lucas-Summers/master

adding support for ueberzug into plugins/preview-tui
master
Mischievous Meerkat GitHub pirms 3 gadiem
vecāks
revīzija
d07c4907de
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. +10
    -1
      plugins/preview-tui

+ 10
- 1
plugins/preview-tui Parādīt failu

@@ -17,7 +17,7 @@
# - 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 @@ preview_file () {
catimg "$1"
elif exists viu; then
viu -t "$1"
elif exists ueberzug; then
preview_ueberzug "$cols" "$lines" "$1"
else
fifo_pager print_bin_info "$1"
fi
@@ -193,6 +195,13 @@ preview_file () {
fi
}

preview_ueberzug() {
{
printf '{"action": "add", "identifier": "nnn_ueberzug", "x": 0, "y": 0, "width": "%s", "height": "%s", "path": "%s"}\n' "$1" "$2" "$3"
read -r
} | ueberzug layer --parser json
}

if [ "$PREVIEW_MODE" ] ; then
if [ ! -r "$NNN_FIFO" ] ; then
echo "No FIFO available! (\$NNN_FIFO='$NNN_FIFO')" >&2


Notiek ielāde…
Atcelt
Saglabāt