20

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.

3

3 Answers 3

7

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.

3

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

2

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).

1
  • Jani Uusitalo's answer works on nautilus 3.4.2 , Ubuntu 12.10
    – totti
    Mar 31, 2013 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .