Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
1  
I did this and indeed it's working. The only problem is that it works only for files, no for dropping of links nor selected text. I modified your code for testing and when dropping a selected text or link $# equals 0. I guess one have to do a 'proper' applet using C or python. Any ideas? –  Cesar Oct 21 '10 at 16:30
    
Well, I must say I think that is a great idea. The problem is that I don't think an applet is the best approach. I personally feel like applets don't fit well in to the desktop. If you want to continue with this idea make sure you let me know. –  W. Goeman Oct 21 '10 at 17:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.