summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-05-27 15:54:16 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-05-27 15:54:16 -0400
commit1260ba7da487785342f05d1fce8d1d5e8b40a343 (patch)
tree0174e5929043430a2f50385920bf9902e0277b9b
parenta6cee230d0cad7b1037e3bca0e7e78123cc432cc (diff)
downloadeibhear-1260ba7da487785342f05d1fce8d1d5e8b40a343.tar.gz
eibhear-1260ba7da487785342f05d1fce8d1d5e8b40a343.tar.zst
eibhear-1260ba7da487785342f05d1fce8d1d5e8b40a343.zip
move/copy files with spaces
-rw-r--r--.config/lf/lfrc15
1 files changed, 9 insertions, 6 deletions
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index e3c7273..f07b8d4 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -16,11 +16,10 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
cmd open ${{
case $(file --mime-type $f -b) in
image/vnd.djvu|application/pdf|application/octet-stream) setsid zathura $fx >/dev/null 2>&1 & ;;
- text/troff) man ./ $f;;
text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | setsid sxiv -aio 2>/dev/null | lf-select & ;;
- audio/*) mpv $f ;;
+ audio/*) mpv --audio-display=no $f ;;
video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;;
application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;;
*) for f in $fx; do setsid $OPENER $f >/dev/null 2>&1 & done;;
@@ -42,8 +41,10 @@ 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}/directories | fzf)" &&
- eval mv -iv $fx $dest &&
+ dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" &&
+ for x in $fx; do
+ eval mv -iv \"$x\" \"$dest\"
+ done &&
notify-send "🚚 File(s) moved." "File(s) moved to $dest."
}}
@@ -51,8 +52,10 @@ 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}/directories | fzf)" &&
- eval cp -ivr $fx $dest &&
+ dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" &&
+ for x in $fx; do
+ eval cp -ivr \"$x\" \"$dest\"
+ done &&
notify-send "📋 File(s) copied." "File(s) copies to $dest."
}}