diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-04-13 21:47:49 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-04-13 21:47:49 -0700 |
commit | 2036cee1f00d93a7ff6aa76ed92661e66e14ec51 (patch) | |
tree | f76880083fdd40d2e77b2b4ad122cf0b60598b83 /configs | |
parent | 4b303d97299d31ba3b3a651010650785c825d84d (diff) |
lf previewer not using due to security concerns
Diffstat (limited to 'configs')
-rwxr-xr-x | configs/configs_root_dir/home/xyz/.config/lf/previewer | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configs/configs_root_dir/home/xyz/.config/lf/previewer b/configs/configs_root_dir/home/xyz/.config/lf/previewer new file mode 100755 index 0000000..8ef5d6a --- /dev/null +++ b/configs/configs_root_dir/home/xyz/.config/lf/previewer @@ -0,0 +1,21 @@ +#!/bin/sh +# not using it because security concerns, see: https://wiki.archlinux.org/title/Lf#Sandboxing_previews + +# references: +# `man lf` PREVIEWING FILES section +# maybe useful: +# https://github.com/LukeSmithxyz/voidrice/tree/master/.config/lf +# https://github.com/ranger/ranger/blob/master/ranger/data/scope.sh + +case "$1" in + # atool has more outputs like file mode bits but slower + #*.7z|*.zip|*.tar*) atool -l "$1";; + *.tar*) tar tf "$1";; + *.zip) unzip -l "$1";; + *.rar) unrar-free l "$1";; + *.7z) 7z l "$1";; + # pdftotext has better output than mutool + *.pdf) pdftotext "$1" -;; + #*.pdf) mutool draw -F txt "$1";; + *) highlight -O ansi -t4 "$1";; +esac |