NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
272 stars 26 forks source link

chafa: Unknown option -f when using lf #65

Open ogios opened 1 year ago

ogios commented 1 year ago

met this issue after installed chafa and ctpv in ubuntu:

apt install chafa libmagic-dev
git clone https://github.com/NikitaIvanovV/ctpv
cd ctpv
make
sudo make install

lfrc:

set previewer ctpv
set cleaner ctpvclear
&ctpv -s $id
&ctpvquit $id

# Basic Settings
set hidden true
set ignorecase true
set icons true

# Custom Functions
cmd mkdir ${{
  printf "Directory Name: "
  read ans
  mkdir $ans
}}

cmd mkfile ${{
  printf "File Name: "
  read ans
  nvim $ans
}}

# Archive bindings
cmd unarchive ${{
  case "$f" in
      *.zip) unzip "$f" ;;
      *.tar.gz) tar -xzvf "$f" ;;
      *.tar.bz2) tar -xjvf "$f" ;;
      *.tar) tar -xvf "$f" ;;
      *) echo "Unsupported format" ;;
  esac
}}

# nvim
cmd open_nvim ${{
    nvim
}}
cmd open_nvim_file ${{
    nvim "$f"
}}

# fuzzy finder
cmd fzf_jump ${{
    res="$(find . -maxdepth 1 | fzf --reverse --header='Jump to location')"
    if [ -n "$res" ]; then
        if [ -d "$res" ]; then
            cmd="cd"
        else
            cmd="select"
        fi
        res="$(printf '%s' "$res" | sed 's/\\/\\\\/g;s/"/\\"/g')"
        lf -remote "send $id $cmd \"$res\""
    fi
}}

map <c-f> :fzf_jump
map E :open_nvim
map e :open_nvim_file

# Bindings
map d
map m

map c $vscodium "$f"

map au unarchive
map ae $wine "$f"

# Basic Functions
map . set hidden!
map dd trash
map dr restore_trash
map p paste
map x cut
map y copy
map <enter> open
map <backspace2> :updir
map J :updir; down; open
map K :updir; up; open
map R reload
map mf mkfile
map md mkdir
map bg setwallpaper
map C clear
map S shell

# Movement
map gn cd ~/.config/nvim
map gl cd ~/.config/lf
map gw cd ~/work
map gh cd ~
map ga cd ~/app
map gt cd ~/.local/share/Trash/files

then this happend: image

i don't know why, is it about the version of chafa? i'm using apt install in ubuntu:

❯ chafa --version
Chafa version 1.2.1

Features: mmx sse4.1 popcnt
Applying: mmx sse4.1 popcnt

Copyright (C) 2018 Hans Petter Jansson et al.
Incl. libnsgif copyright (C) 2004 Richard Wilson, copyright (C) 2008 Sean Fox

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ogios commented 1 year ago

it's about the version ubuntu's apt always seems to have trouble with version updates🤔

NikitaIvanovV commented 1 year ago

I think I should look into building ctpv with libchafa or something because I have to use some more recent features which are available on odd versions shipped with Ubuntu.

I will look into it and close the issue once it's fixed.

By the way, have you managed to get around this problem?

ogios commented 1 year ago

By the way, have you managed to get around this problem? l

yes, i download the latest version from chafa's github release, and it works now