From 7452fd681ca22425433f58b3de5cac1e97e92eec Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 8 Dec 2019 19:20:25 -0500 Subject: [PATCH] oops! lf-select added --- .config/lf/lfrc | 2 +- .local/bin/lf-select | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 .local/bin/lf-select diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 741f1a9..2a5786a 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -15,7 +15,7 @@ cmd open ${{ text/troff) man ./ $f;; text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;; - image/*) rotdir $f | setsid sxiv -aio 2>&1 | lf-select & ;; + image/*) rotdir $f | setsid sxiv -aio 2>/dev/null | lf-select & ;; audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; video/*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f -quiet >/dev/null 2>&1 & ;; application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;; diff --git a/.local/bin/lf-select b/.local/bin/lf-select new file mode 100755 index 0000000..3b2a17a --- /dev/null +++ b/.local/bin/lf-select @@ -0,0 +1,9 @@ +#!/bin/sh + +# Reads file names from stdin and selects them in lf. + +while read -r file; do + [ -z "$file" ] && continue + lf -remote "send select \"$file\"" + lf -remote "send toggle" +done