move/copy files with spaces
This commit is contained in:
parent
a6cee230d0
commit
1260ba7da4
1 changed files with 9 additions and 6 deletions
|
@ -16,11 +16,10 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
|
||||||
cmd open ${{
|
cmd open ${{
|
||||||
case $(file --mime-type $f -b) in
|
case $(file --mime-type $f -b) in
|
||||||
image/vnd.djvu|application/pdf|application/octet-stream) setsid zathura $fx >/dev/null 2>&1 & ;;
|
image/vnd.djvu|application/pdf|application/octet-stream) setsid zathura $fx >/dev/null 2>&1 & ;;
|
||||||
text/troff) man ./ $f;;
|
|
||||||
text/*) $EDITOR $fx;;
|
text/*) $EDITOR $fx;;
|
||||||
image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;;
|
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 & ;;
|
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 & ;;
|
video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;;
|
||||||
application/pdf) setsid zathura $fx >/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;;
|
*) 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
|
clear; tput cup $(($(tput lines)/3)); tput bold
|
||||||
set -f
|
set -f
|
||||||
clear; echo "Move to where?"
|
clear; echo "Move to where?"
|
||||||
dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" &&
|
dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" &&
|
||||||
eval mv -iv $fx $dest &&
|
for x in $fx; do
|
||||||
|
eval mv -iv \"$x\" \"$dest\"
|
||||||
|
done &&
|
||||||
notify-send "🚚 File(s) moved." "File(s) moved to $dest."
|
notify-send "🚚 File(s) moved." "File(s) moved to $dest."
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -51,8 +52,10 @@ cmd copyto ${{
|
||||||
clear; tput cup $(($(tput lines)/3)); tput bold
|
clear; tput cup $(($(tput lines)/3)); tput bold
|
||||||
set -f
|
set -f
|
||||||
clear; echo "Copy to where?"
|
clear; echo "Copy to where?"
|
||||||
dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" &&
|
dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" &&
|
||||||
eval cp -ivr $fx $dest &&
|
for x in $fx; do
|
||||||
|
eval cp -ivr \"$x\" \"$dest\"
|
||||||
|
done &&
|
||||||
notify-send "📋 File(s) copied." "File(s) copies to $dest."
|
notify-send "📋 File(s) copied." "File(s) copies to $dest."
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue