Okay after a couple of minutes playing around, I’ve done a proof of concept for creating a simple Copy to Caja-Action. I’ve deliberately kept it simple to and encourage you to tailor it to your needs.
The script is very simple:
#!/bin/bash
OUTPUT=$(zenity --file-selection --directory --title="Choose your destination")
TARGETDIR=$(awk -F, '{print $1}' <<<$OUTPUT)
cp "$1" "$TARGETDIR/"
To create the Caja-Action:
- Save the script file as /home/username/bin/copy_to.sh and make it executable.
- Open the Caja-Actions Configuration Tool
- Create a new action
- Under the Action tab, give your action a Context label i.e. ‘Copy to…’
- Under the Command tab, enter the path (i.e. /home/username/bin/copy_to.sh) to your script and enter %f in the Parameters field
To use the action:
- Right-click the file you want to copy and select Caja-Actions actions -> Copy to
- In the popup window, select the directory you wish to copy the file to and click OK
- The file will be copied
Customisation and refinement
This is a barebone proof-of-concept only. Feel free to edit the script to suit your needs, for example, copying multiple files, creating a Move to version, checking if a file already exists in the target directory etc…