Skip to content

eylles/vifm-sixel-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Previews in vifm for sixel capable terminals

Kind of a clone of vifmimg but for sixel

This script is used along vifm to generate image previews for various file types in vifm.

The script is currently able to handle the following formats:

  • Video
  • eBook
  • Images
  • Audio files
  • Fonts

All previews are cached (except for regular images) and stored in your ~/.cache/vifm/ folder.

Installation

  1. git clone https://github.com/eylles/vifm-sixel-preview

  2. cd vifm-sixel-preview

  3. make install

  4. Edit your ~/.config/vifm/vifmrc file and add fileviewer properties like so:

    fileviewer *.pdf
        \ vifm-sixel pdf %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

    fileviewer *.epub
        \ vifm-sixel epub %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

    fileviewer <video/*>
        \ vifm-sixel video %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

    fileviewer <image/*>
        \ vifm-sixel draw %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

    fileviewer <audio/*>
        \ vifm-sixel audio %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

    fileviewer <font/*>
        \ vifm-sixel font %pw %ph %c %pd
        \ %pc
        \ vifm-sixel clear

Prerequisites

TODO

  • try to autodetect col and row pixel size (apparently can only be done for xterm and mlterm)
  • use montage to center the image over the correct preview panel bg color (will have to take code from lsix)

Credits

vifmimg

show-sixel