summaryrefslogtreecommitdiffstats
path: root/.config/lf/lfrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/lf/lfrc')
-rw-r--r--.config/lf/lfrc10
1 files changed, 8 insertions, 2 deletions
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"