MyNixOS website logo
option

programs.lf.previewer.source

Script or executable to use to preview files. Sets lf's previewer option.

Declarations
Type
null or path
Default
null
Example
pkgs.writeShellScript "pv.sh" ''
  #!/bin/sh

  case "$1" in
      *.tar*) tar tf "$1";;
      *.zip) unzip -l "$1";;
      *.rar) unrar l "$1";;
      *.7z) 7z l "$1";;
      *.pdf) pdftotext "$1" -;;
      *) highlight -O ansi "$1" || cat "$1";;
  esac
''