Move to .. , Copy to .. in Caja

Ok @IvCHo, I’m in the office now!

Simplest way to add a progress bar is with another Zenity widget. Here’s the code:

(
echo "10" ; sleep 1
cp -r "$1" "$TARGETDIR/" ; sleep 1
echo "100" ; sleep 1

) |

zenity --progress \
      --title="Copy to" \
      --text="Copying..." \
      --percentage=0

Replace your cp ling in the original script with the above and you’ll get a basic progress bar. Note that I’ve included the -r switch as per @rohithmadhavan to allow for recursiving copying of folders.

Note that the widget works by letting you specify the steps so it’s not a true progress bar as such. You can probably write a more complicated recursive cp statement inside a loop that updates divides the number of files you are copying by 100 and update the progress bar accordingly when each file is copied across.

There may be some way of using Caja’s native progress bar but I haven’t looked into that.

1 Like