From 407ffa310eaa8ece8880bafe5f64c3cb50dc6ea0 Mon Sep 17 00:00:00 2001 From: davidpkj Date: Sat, 25 Feb 2023 17:50:35 +0100 Subject: Update lf --- lf/.config/lf/lfrc | 5 +++++ lf/.config/lf/scope | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lf/.config/lf/lfrc b/lf/.config/lf/lfrc index 6380420..430dbde 100755 --- a/lf/.config/lf/lfrc +++ b/lf/.config/lf/lfrc @@ -70,7 +70,12 @@ cmd setbg ${{ wally "$fx" > /dev/null }} +cmd copypath ${{ + pwd | xclip -selection clipboard +}} + # Bindings +map P copypath map D delete map E extract map . set hidden! diff --git a/lf/.config/lf/scope b/lf/.config/lf/scope index 618bde3..c90f618 100755 --- a/lf/.config/lf/scope +++ b/lf/.config/lf/scope @@ -27,18 +27,18 @@ case "$(file --dereference --brief --mime-type -- "$1")" in text/troff) man ./ "$1" | col -b ;; text/* | */xml | application/json) bat -p --theme base16 --terminal-width "$4" -f "$1" ;; application/zip) atool --list -- "$1" ;; - audio/* | application/octet-stream) mediainfo "$1" || exit 1;; + audio/* | application/octet-stream) mediainfo "$1" || exit 1;; video/* ) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" [ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0 image "$CACHE" "$2" "$3" "$4" "$5" ;; - */pdf) + */pdf ) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" [ ! -f "$CACHE.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE" image "$CACHE.jpg" "$2" "$3" "$4" "$5" ;; - *opendocument*) odt2txt "$1" ;; + *opendocument*) odt2txt "$1" ;; application/pgp-encrypted) gpg -d -- "$1" ;; esac exit 1 -- cgit v1.2.3