From d8154a98dd82346a5e90d276abe81e43a1678d41 Mon Sep 17 00:00:00 2001 From: themamiza <131671116+themamiza@users.noreply.github.com> Date: Mon, 1 Jun 2026 02:01:54 +0330 Subject: lf improvements (#1477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove and merge duplicate entries The 'case' statement had two identical commands for opening files using `zathura`. Removed the extra match patterns and merged into one. * Fix file checks * Fix indentation and use the same syntax style All the indentation are fixed. All syntax styles have been set to match the first occurrence. * Slightly faster filename generation for thumbnails Use `md5sum` instead of `sha256sum` since the hash is only used as a cache identifier (no security/integrity requirement). Remove the trailing “ -” that `md5sum` prints for stdin by trimming everything after the first space using POSIX parameter expansion (${var%% *}), avoiding extra processes like `cut` or `awk`. --- .config/lf/lfrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.config/lf/lfrc') diff --git a/.config/lf/lfrc b/.config/lf/lfrc index d877ab6..d38f16a 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -30,7 +30,7 @@ set autoquit true cmd open ${{ case $(file --mime-type "$(readlink -f $f)" -b) in application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; - image/vnd.djvu|application/pdf|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; + image/vnd.djvu|application/vnd.djvu|application/pdf|application/postscript|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; @@ -43,7 +43,6 @@ cmd open ${{ ;; audio/*|video/x-ms-asf) mpv --audio-display=no $f ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; - application/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pgp-encrypted) $EDITOR $fx ;; application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;; application/octet-stream) case ${f##*.} in -- cgit v1.3.1