Skip to content
Discussion options

You must be logged in to vote

I'm temporarily using your script, but not with cmd alt-paste &{{, but with cmd alt-paste ${{ mode, and instead of sudo -A, just sudo, so at least it doesn't transfer the files to be copied/moved. I'll see how useful it is for my work. Thank you for your help and patience.

cmd alt-paste ${{
	if [ "$lf_user_sudo_mode" = "true" ]; then
		mode=$(cat ~/.local/share/lf/files | sed -n '1p')
		case "$mode" in
			copy) cmd="cp"; args="-r" ;;
			move) cmd="mv"; args="-n" ;;
		esac
		while IFS= read -r file; do
			[ -e "$file" ] || continue
			sudo $cmd $args -- "$file" .
		done < ~/.local/share/lf/files
    	lf -remote "send $id :clear; reload"
	else
		lf -remote "send $id :paste; clear; reload"
	…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
15 replies
@DusanLesan
Comment options

@og900aero
Comment options

@og900aero
Comment options

@DusanLesan
Comment options

@og900aero
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by CatsDeservePets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants