diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-12-22 22:07:47 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-12-22 22:07:47 +0100 |
commit | 92750ff52f6df270b9c8a2d3068c7e0ff3374265 (patch) | |
tree | e9f8cce65844b230982d81948547bd0469126a1c /.config/lf/lfrc | |
parent | ec82e0f8cc3f9b451c1ce63a948034c6bb2b5bd2 (diff) |
updates
Diffstat (limited to '.config/lf/lfrc')
-rw-r--r-- | .config/lf/lfrc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 92567e6..9d6ceba 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -14,12 +14,12 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" # cmds/functions cmd open ${{ - case $(file --mime-type $f -b) in - image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; + case $(file --mime-type "$(readlink -f $f)" -b) in + image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | setsid -f sxiv -aio 2>/dev/null | lf-select & ;; audio/*) mpv --audio-display=no $f ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; @@ -36,7 +36,7 @@ cmd extract ${{ printf "%s\n\t" "$fx" printf "extract?[y/N]" read ans - [ $ans = "y" ] && ext $fx + [ $ans = "y" ] && aunpack $fx }} cmd delete ${{ @@ -52,7 +52,7 @@ cmd moveto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Move to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|' )" && + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval mv -iv \"$x\" \"$dest\" done && @@ -63,7 +63,7 @@ cmd copyto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Copy to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|' )" && + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval cp -ivr \"$x\" \"$dest\" done && @@ -75,7 +75,7 @@ cmd bulkrename $vidir # Bindings map <c-f> $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" +map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" map gh map g top map D delete @@ -103,5 +103,7 @@ map <c-e> down map <c-y> up map V push :!nvim<space> +map W $setsid -f $TERMINAL >/dev/null 2>&1 + # Source Bookmarks source "~/.config/lf/shortcutrc" |