From 2036cee1f00d93a7ff6aa76ed92661e66e14ec51 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 13 Apr 2024 21:47:49 -0700 Subject: lf previewer not using due to security concerns --- .../configs_root_dir/home/xyz/.config/lf/previewer | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 configs/configs_root_dir/home/xyz/.config/lf/previewer (limited to 'configs') 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 -- cgit 1.4.1