diff --git a/.config/lf/lf_kitty_clean b/.config/lf/lf_kitty_clean new file mode 100755 index 0000000..16a2e66 --- /dev/null +++ b/.config/lf/lf_kitty_clean @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty diff --git a/.config/lf/lf_kitty_preview b/.config/lf/lf_kitty_preview new file mode 100755 index 0000000..6816469 --- /dev/null +++ b/.config/lf/lf_kitty_preview @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +file=$1 +w=$2 +h=$3 +x=$4 +y=$5 + +if [[ "$( file -Lb --mime-type "$file")" =~ ^image ]]; then + kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "$file" < /dev/null > /dev/tty + exit 1 +fi + +# pistol "$file" diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 1a2d8d3..1251989 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,3 +1,7 @@ +# kitty previewer +set previewer ~/.config/lf/lf_kitty_preview +set cleaner ~/.config/lf/lf_kitty_clean + # extract the current file with the right command # (xkcd link: https://xkcd.com/1168/) cmd extract ${{