updated readme
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
set icons true
|
||||
set previewer ~/.local/bin/lfpreview
|
||||
set previewer ~/.config/lf/scripts/lfpreview
|
||||
cmd on-select &{{
|
||||
exec lf -remote 'redraw'
|
||||
}}
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
draw() {
|
||||
kitten icat --stdin no --transfer-mode memory \
|
||||
--place "${w}x${h}@${x}x${y}" "$1" </dev/null >/dev/tty
|
||||
}
|
||||
|
||||
file="$1"
|
||||
w="$2"
|
||||
h="$3"
|
||||
x="$4"
|
||||
y="$5"
|
||||
|
||||
case "$(file -Lb --mime-type "$file")" in
|
||||
image/*)
|
||||
draw "$file"
|
||||
;;
|
||||
application/pdf)
|
||||
pdftoppm -f 1 -singlefile "$file" "/tmp/lfoutput"
|
||||
draw "/tmp/lfoutput.ppm"
|
||||
;;
|
||||
*)
|
||||
bat --color=always "$1"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 1 # do not cache
|
||||
Reference in New Issue
Block a user