Copy To, Move to in Caja

system
caja

#1

Hello,
I am a using linux from a while but a new user of ubuntu mate. Before mate I was using Linux mint. in linux mint file manager (Nemo) if I right click on a file I have an option copy to or move to by using that I can copy or move any file into home, Documents, Video, Music etc. but in mate file manager (Caja) I don't have these option. any help regarding this to make life a little easier.

thank you so much in advance!


#2

I also think copy / move to is pretty lame in CAJA. My work around is copy or cut the selections and paste into the desired location.


#3

if caja team insert mentioned folder in copy to/move to menu. it will become easy job.


#4

There are a few use-cases where the copy/move to dialog definitely isn’t lame :slight_smile: For example, where you’re copying files to multiple locations, in which case you’d just select the destination after engaging the dialog, and then kick off the next transaction without having to re-navigate. OP has a point. :wink:


#5

@shahmoeen See here - Move to .. , Copy to .. in Caja I’ve changed the scripts minutely to improve them.

These scripts should be placed in .config/caja/scripts/ where they will be available on a right click of your file, Scripts>.

copy_to is as follows -

#!/bin/bash
numberArgs=$#

OUTPUT=$(zenity --file-selection --directory --title="Choose your target directory")

if [ "$?" -eq 1 ]; then
    zenity --error --text="Cancelled"
    exit 1
fi

TARGETDIR=$(awk -F, '{print $1}' <<<$OUTPUT)

 for (( i=1; i<=$numberArgs; i++ )); do
    echo "# ${1##*/}"
    cp -p -r "${1}" "$TARGETDIR/"
    echo "$(( (i * 100)/$numberArgs ))"
    sleep 0.5 
    shift 1
done | zenity --progress --title="Copy files to $TARGETDIR" --percentage=0

if [ "$?" -eq 1 ]; then
    zenity --error --text="Cancelled!"
    exit 1
fi

move_to is as follows -

#!/bin/bash
numberArgs=$#

OUTPUT=$(zenity --file-selection --directory --title="Choose your target directory")

if [ "$?" -eq 1 ]; then
	zenity --error --text="Cancelled"
# --auto-close
	exit 1
fi

TARGETDIR=$(awk -F, '{print $1}' <<<$OUTPUT)

for (( i=1; i<=$numberArgs; i++ )); do
	echo "# ${1##*/}"
	cp -r --preserve=all "${1}" "$TARGETDIR/"
	rm -r "${1}"
	echo "$(( (i * 100)/$numberArgs ))"
	sleep 0.5
	shift 1
done | zenity --progress --title="Copy files to $TARGETDIR" --percentage=0 
# --auto-close

if [ "$?" -eq 1 ]; then
	zenity --error --text="Cancelled!" 
# --auto-close
	exit 1
fi