From 6184e00392c28f9903b519d4a63680b06436e894 Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 1 Mar 2025 22:00:30 +0100 Subject: waylanded --- .config/lf/lfrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to '.config/lf/lfrc') diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 563c155..19653c1 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -14,6 +14,11 @@ set previewer '~/.config/lf/scope' # cmds/functions cmd open ${{ + if [ -n "$WAYLAND_DISPLAY" ]; then + IMAGER=imv + else + IMAGER="nsxiv -aibo" + fi case $(file --mime-type "$(readlink -f $f)" -b) in application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; application/vnd.openxmlformats-officedocument.wordprocessingml.document) docx2txt $f | $PAGER ;; @@ -23,8 +28,9 @@ cmd open ${{ text/*|application/json|inode/x-empty) bat --style=plain --tabs 4 --paging=always -f $fx ;; image/x-xcf) gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | - nsxiv -aibof 2>/dev/null | while read -r file; do + image/*) + rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | + $IMAGER 2>/dev/null | while read -r file; do [ -z "$file" ] && continue lf -remote "send select \"$file\"" lf -remote "send toggle" -- cgit v1.2.3