Ubuntu – How to drag and drop files to a places applet. (Like trash can)

appletdrag and dropgnome-panel

I made a shortcut to my home folder by dragging and dropping it to the panel.

Is there a way that I can drag and drop files to that applet in order to save the file
in the folder location?

What I really want is to make a shortcut to one of my Ubuntu One folders, that when I drag and drop a file, selected text or url to that applet, it saved the dropped 'element' in the folder for synchronization purposes.

EDIT

Like the trash can but with a custom selected folder.

Best Answer

The following script will act according to your desciption. I believe this is not the best approach for this situation, but there is not an applet with the functionality described by you that I know of.

Create a file in your home folder with the following content:

#!/bin/sh

ubuntuone_loc="/home/user/Ubuntu One/"

if [ $# -eq 0 ] ;
then 
  nautilus "$ubuntuone_loc"
else
  (
    i=0
    for file in "$@" ; 
    do
      echo $(($i * 100 / $#))
      i=$(($i+1))
      cp "$file" "$ubuntuone_loc"
    done
    echo 100
  )|zenity --progress --title="Copy files progress" --text="Copying $# files to $ubuntuone_loc..." --auto-close &

  RUNNING=0
  while [ $RUNNING -eq 0 ]
  do
    if [ -z "$(pidof zenity)" ]
    then
      kill $(pidof cp)
      RUNNING=1
    fi
  done

fi

Make sure you replace "/home/user/Ubuntu One" with your ubuntu one folder. Now create a new custom launcher, and fill in "sh /path/to/the/created/file". The new launcher should work with clicking and drag and drop.

I hope this works for you. A custom Ubuntu One applet with this sort of behaviour would be nice.

Related Question