diff --git a/.config/lf/lfrc b/.config/lf/lfrc index dad917df..5598a307 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -92,25 +92,37 @@ cmd delete ${{ }} cmd moveto ${{ - clear; tput cup $(($(tput lines)/3)); tput bold set -f - clear; echo "Move to where?" - dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${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 --prompt 'Move to where? ' | sed 's|~|$HOME|') + [ -z "$dest" ] && exit + destpath=$(eval printf '%s' \"$dest\") + clear; tput cup $(($(tput lines)/3)); tput bold + echo "From:" + echo "$fx" | sed 's/^/ /' + printf "To:\n %s\n\n\tmove?[y/N]" "$destpath" + read -r ans + [ "$ans" != "y" ] && exit for x in $fx; do - eval mv -iv \"$x\" \"$dest\" + mv -iv "$x" "$destpath" done && - notify-send "🚚 File(s) moved." "File(s) moved to $dest." + notify-send "🚚 File(s) moved." "File(s) moved to $destpath." }} cmd copyto ${{ - clear; tput cup $(($(tput lines)/3)); tput bold set -f - clear; echo "Copy to where?" - dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${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 --prompt 'Copy to where? ' | sed 's|~|$HOME|') + [ -z "$dest" ] && exit + destpath=$(eval printf '%s' \"$dest\") + clear; tput cup $(($(tput lines)/3)); tput bold + echo "From:" + echo "$fx" | sed 's/^/ /' + printf "To:\n %s\n\n\tcopy?[y/N]" "$destpath" + read -r ans + [ "$ans" != "y" ] && exit for x in $fx; do - eval cp -ivr \"$x\" \"$dest\" + cp -ivr "$x" "$destpath" done && - notify-send "📋 File(s) copied." "File(s) copies to $dest." + notify-send "📋 File(s) copied." "File(s) copied to $destpath." }} cmd setbg "$1"