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.

How can I start Nautilus's "File Operations" GUI from the command line?

File Operations

My goal is to include this in a Nautilus script.

share|improve this question
2  
I'm not sure I understand the purpose/point. –  RolandiXor Jul 7 '11 at 3:06
    
why don't you just use 'cp' command in bash? if you want to visualize a transfer you can use zenity progress bar. something like 'zenity --progress --text="Transfering files .." --title="Transfer begun"' would work. for more info on zenity look at manpage and the links : ubuntuforums.org/archive/index.php/t-306515.html ubuntuforums.org/archive/index.php/t-183228.html library.gnome.org/users/zenity/stable/… –  gourgi Jul 24 '11 at 21:04
    
@gourgi I want it to integrate with the progress indicator for any transfers I may have already started via Nautilus. –  ændrük Jul 25 '11 at 15:43

3 Answers 3

up vote 6 down vote accepted

The short answer is, you can't. Nautilus is not built to allow that sort of thing and you can go through the source code of nautilus and look at the file copy/move sections to see how it works.

Part of this lack of integration was the motivation behind the progress indicator design. It would replace the nautilus progress window and several other progress inconsistencies and allow multiple programs to show their progress to the user in the same way:

https://wiki.ubuntu.com/Ayatana/ProgressIndication

More work and advocacy for these new designs would help, allowing integration of all sorts of tools.

share|improve this answer

From a discussion in irc://irc.gnome.org#nautilus, I can say that the current version of Nautilus do not expose methods for file operation on D-Bus, but version 3.0 will do, so the answer should be

you can't, now, but you will in the future

share|improve this answer

Apparently this is now supported; at least the following seems to work under 12.04:

qdbus org.gnome.Nautilus /org/gnome/Nautilus org.gnome.Nautilus.FileOperations.CopyFile "file:///source/directory" "*" "file:///destination/directory" ""

where /source/directory is the absolute path to your source directory, * is the glob for file[s] to copy, /destination/directory is your destination directory and the last "" is for destination file name. Note that you need to have the last one there even if it's empty as in here, to fulfill the method signature. Also, if you specify a target name and have multiple source files, they'll all get copied to that one destination file, giving an overwrite prompt for each file after the first one (which may or may not be what you want).

share|improve this answer
    
Jani Uusitalo's answer works on nautilus 3.4.2 , Ubuntu 12.10 –  totti Mar 31 '13 at 9:30

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.