PLEASE NOTE: This article is for earlier versions of Nautilus File Manager (2.x) found in earlier Ubuntu releases running on Gnome 2.x, so will not work in Unity (the default desktop environment) or Gnome Shell, both of which are based on Gnome 3.
☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻
You can add some extra buttons to your Nautilus toolbar, simply by editing a bit of text. What I’ll show you how to do is add buttons for “New Folder” (to create a new folder in the current one), standard editing tools “Cut“, “Copy” and “Paste“, as well as a “Trash” button (to move items to Trash).
There will be a separator after “New Folder“, and the new buttons will be in the centre of the toolbar, but you can leave out the separator (or add more), put the buttons wherever you want, and of course leave out any button you don’t think you’ll ever need.
You can also add an optional “Delete” button, which will bypass the Trash and permanently delete the selected item(s). While this sounds dangerous, you will get a warning message informing you of what you are about to do (unless you disabled that in Nautilus’ preferences), and you will need to click to proceed.
What you’ll be doing is editing a Nautilus configuration file, so we’ll back it up first, just in case. Simply copy the whole command below and paste it in a terminal, and it will backup nautilus-navigation-window-ui.xml before opening it up for editing:
cd /usr/share/nautilus/ui/ && sudo cp nautilus-navigation-window-ui.xml nautilus-navigation-window-ui-BACKUP.xml && sudo gedit nautilus-navigation-window-ui.xml
Copy the following text and paste it between the “Go to Computer” and “Zoom” toolbar entries near the bottom of the file:
<separator/>
<toolitem name=”New Folder” action=”New Folder”/>
<separator/>
<toolitem name=”Cut” action=”Cut”/>
<toolitem name=”Copy” action=”Copy”/>
<toolitem name=”Paste” action=”Paste”/>
<toolitem name=”Trash” action=”Trash”/>
If you want to maintain the formatting of the code, hit the Tab key once at the beginning of each line, so it looks like:
To add that “Delete” button, add the following code after the “Trash” entry (or wherever you want), and you can even add a separator between the two, to save you accidentally clicking the wrong one:
<toolitem name=”Delete” action=”Delete”/>
As you can see, it’s just plain text which you can move around and add to, so feel free to put things where you want and in whatever order you prefer. Then simply save the file once you’re finished, and to make the changes take effect without rebooting, you can force Nautilus to restart with the following command:
killall nautilus
When you open the next folder window, your new buttons should be there. And if you want to edit the config file again in the future, just run the following command:
sudo gedit /usr/share/nautilus/ui/nautilus-navigation-window-ui.xml
◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊◊
RELATED GUIDES:
Add a File/Folder “Properties” Button to the Nautilus Toolbar
Apply New Settings Immediately Without Rebooting
☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻
Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!
I am hooked on these toolbar buttons. Is there a way to add “Open Terminal” button. I have “open-terminal” functionality installed in gnome but want to open in via toolbar instead of right-click.
thanks
peter
I did try a few things, like adding custom Nautilus actions and the nautilus-open-terminal plugin, but seems these buttons are for “built-in” features like your standard editing buttons, etc. Of course, it could be that I am just not using the correct words or syntax, so will keep looking into it.
Oh, you can add more default stuff, like one for Properties – just use that word for both instances in the line of code (ie: ). I didn’t include that in the guide, as I just wanted to cover the basic options most newbies would be missing. More advanced users will find links from that guide to other buttons they can add (when I do one for Properties, probably later today, and hopefully find out how to add Open in Terminal!).
I followed your instructions several times – every time I restart Nautilus, there is no menu at all, it’s just gone. I restored the backup and all is well, but even after several attempts I can’t get it to work. Any help? I’d like to make it work, and I bet it something small.
I’m running 10.4 Ubuntu
Thanks
Nils
OK, first checking exactly which menu you are referring to: do you mean the whole menu bar goes missing (ie: File, Edit, View, etc)? Also, which button(s) are you trying to add, and any other useful info that might help? The only thing I ever came across was some of the end buttons going out of view (but still accessible via the “more options” arrow/pulldown-menu thingy) when I was using an icon theme that not so much made the buttons large, but widely spaced.
Sorry, I thought about that first thing when I woke up. It’s not the menu that’s gone, it’s the toolbar.
I followed your instructions above (ie, cut and paste the following:
Then when I restart Nautilus, there is no toolbar (Back, Forward, Up, etc buttons). Also, the options in the view menu change – all the options that should be in the 2nd separator are gone (turn on/off the main toolbar, side pane, location bar, status bar are all missing). It’s almost like there was a syntax error that prevented it from completing the configuration, so it just skipped the whole toolbar.
Any ideas?
OK, any incorrect syntax and unknown options/commands (and putting the code in the wrong area) will cause this behaviour (actually, just the toolbar missing, or incomplete, to my knowledge). Since the code above is fine (not sure what you pasted for me to see, as it isn’t there), all I can think of is you didn’t put it in the correct place, so check that.
As you can see the code to copy/paste is the same as in the picture of the contents of the config file, though I did hit Tab before each line to make it look like the rest of the document; while that shouldn’t matter, you might find if you didn’t do that already it might help (though don’t expect much).
All I can suggest after that is adding one button at a time and seeing what happens. Hope you have success. Cheers
Hi everyone. First thanks for the article.
I was experiencing the same problem that Nils. The issue is the double quotes, if you take a good look you will see that the ones at the web page are not “straight” while the ones on the picture of the config file are. Delete the ones you copy from this page and add yous own quotes. This worked for me.
Cheers
Hi, and thanks for pointing that out. I have no idea how this state of affairs came about, well, except for one word: WordPress! I’ve spent the last week trying to sort out another issue where I type in one thing and another is displayed. Apparently they have all these filters for stopping malicious code, but all it does id cause me headaches… like this latest one. Funny thing is others have used this guide successfully, and I gather by simply copying and pasting, and I think I even copied from here for another PC I was setting up, so not sure if those quotes got “converted” later. I thought it might be encoding of the text editor, but tried gedit and mousepad and it is unanimous so far that the characters are no longer double quotes. Gedit even lets you know something is wrong by highlighting in red. And I notice this only happens to those quotes in bold, though it shouldn’t be something I have to avoid doing to keep the characters the same. I will try to change the quotes but at least will add this info to the article. Cheers.
Thanks for the tip. I will try it out. Appreciate the feedback.
Nils
Thanks for the help. I tried typing it manually, and it worked fine. Must have been the double quotes. Glad someone caught that – I never would have!!
Anyone have any clues on the next mystery?:
Cut, Copy, Paste, Properties, and Trash buttons show up just fine on the tool bar when I use the instructions. “Delete” button will not show up, nor anything that comes after it. Also, the separators do not show up (they show up in the menus, and in the tool bars of other applications, like gedit, but not in the toolbar of Nautilus).
I played around with it to get a feel for how it works, and I noticed other things, like it won’t let you use duplicate buttons. I’d like to know more – what language are we working with here, and is there somewhere I can find a more in depth explanation?
It may be relevant that I loaded Mac4Linux a while back, which changes the appearance of the windows. I remember a comment during the installation about some Nautilus toolbar feature now being disabled by default, but I can’t remember which one.
I’d appreciate any insight.
Nils
OK, appears this is the “smart quotes” feature of WordPress – turning straight quotes into “curly” quotes – and seems to be one of the MAJOR annoyances of WordPress bloggers. Despite people going nuts with this for at least 3 years, with I don’t doubt thousands of support requests hitting their desks, not to mention over 2 million pages on this issue in Google, WordPress seem to stand behind this, and offer no way to get around it. I’ve yet to hear back from their support staff, but I gather the gist of it will be “this is a really great feature we won’t turn off; if you don’t like it, please delete your WordPress blog and create another elsewhere”, hehehe. I can’t believe that while making the quotes look more presentable, they are actually converting those characters to something else, and that even when you manually enter the correct code for double-quotes, they still get autoformatted to something useless.
I’ve now managed to convert all those stupid curly quotes into normal “straight” ones, so all code in this article should now work fine! Many thanks to WordPress for giving me something to do, ie: go throughout my whole blog looking for single- and double-quotes that need replacing, as, you know, I actually didn’t have anything better to do! hehe
Thanks for your useful guide!
Two remarks:
“nautilus -q” is a more elegant way to restart nautilus.
Also, you should use gksudo instead of sudo for gui applications.
Thanks for the Nautilus option tip. But as for gksudo, there are only a few instances (ie: programs) where that actually makes a difference, which is why you see the widespread use of sudo in online guides. I’ve even forgotten which handful of apps react differently when using sudo instead of gksudo, and what oddities arise from using sudo, and I’ve never had any issue using sudo with gui apps… ever. But point taken that TECHNICALLY gksudo should be used, at least once upon a time.
thank you very much for the info
[…] Ubuntu Genius. Posts Relacionados:Los Pitufos 3D, ¡nueva imagen de […]
Dear Ubuntu Genius,
What is the command to add “Clean up by type” command to the Desktop right-click menu (below “Clean up by name” already existing)?
M Cris
Hmm, that’s a good question. In 10.10, the available command is called “Organize Desktop by Name”, but I can’t see any way to do that for type. Not sure why people want this, since generally there’ll only be launchers, but seems people used to doing this in Windows (for whatever reason) are looking for a way to do so in Ubuntu. From what I’ve heard, it actually isn’t possible in Gnome (though it is in KDE), but many have filed this as a bug and added it to the wishlist, so it might be there when Gnome 3 finally comes out. But don’t quote me on it. Only thing you could do is open the desktop in a Nautilus window and arrange items by type there. If you find a way to do it on the desktop itself, please let us know!
Thanks for interest. About “why people want this” it’s because I use to download directly onto Desktop (instead of Home folder or Documents) so I have the downloaded items more “handy”.
In this way, the Desktop gets crowded and I need the cleanup function.
If you have any suggestion about this…
(Also I use g-OS gadgets, and it’s based on Ubuntu 8.
I would like to upgrade it to Ubuntu 10 but I don’t really know how…)
OK, each to their own, but as you can see this is working against you. While wanting them to be “handy”, you’re actually ending up with a cluttered desktop you need to sort before you can find those things you’ve downloaded. Wouldn’t it be more effective to download stuff to a Downloads folder, and just have a Nautilus (file manager) window open to that folder?
Your way you have to minimise everything to see the desktop; my way you have to bring your Downloads folder to the forefront (either way needs a click, unless you never have anything open, and are always looking at the desktop). This only involves having one extra window open, but of course you can create a launcher for it on your panel, and just open and close as you need it. That way, your files will be in alphanumeric order (by default – you can change that to filesize or date or whatever you want).
[And just in case anyone reading this is wondering how to download to other than the desktop in Firefox (which for ages was the default location – don’t ask me why – but in recent versions of Ubuntu has been ~/Downloads), you’ll find you can change that in Edit > Preferences.]
As for the Ubuntu core in gOS, not sure how you would go about that, or if it’s even possible, but since you are not using 2.9 or before (there were massive update/upgrade problems before 3.0), I would try it via the Update Manager. You’ll have to eventually do something, as gOS is in effect a dead distro, with no development since 2009.
Thank you, I think you are right with the Download folder after-all. Probably also about g-OS, but I still love it ;)
By the way, g-OS gets updated along with Ubuntu 8.08 Hardy, so my only problem is when Ubuntu 8 will stop updating.
Also, the Desktop download problem is not with Firefox (there are options here) but with Prism. I couldn’t find how to change the default download location of Prism.
Thanks – just what I needed to know.
R.
Any chance you know how to do this for Nautilus-Elementary?
I’ve hacked just about everything else to do with it, but custom toolbar buttons eludes me. The code you are utilising is deprecated in Nautilus-Elementary.
Sorry. As you’ve seen, with custom builds it’s a completely different matter, so best to contact the developers. All the best.
The new Nautilus version 3.xx does not allow the customization anymore.
What a shame!
Yes, that’s right: this won’t work with Ubuntu 11.10/Gnome 3/Nautilus 3.2.Only thing that happens is the 3 remaining buttons disappear if you try to add new ones.
I wish I’d read that last comment about an hour ago… D’OH! ;-)
(Might be worth stating that upfront for any other impatient noobs…)
Hi. This issue is that a lot of these articles were written during the recently departed Gnome 2 era, so need to have an intro stating that (I’ve already started, but with so many articles, it’s a long job, and I’ve still got many to go, especially since many need specific info added). Most of those that no longer work are generally harmless, just annoying that such good tricks are now useless. In this case, all you had to do was revert the data in the file, and all is back to normal. But thanks for alerting me to this one, as this should be the next one I update (since there is a side-effect).
fantastic issues altogether, you just won a new reader.
Excellent blog post. I definitely appreciate this website.
Keep it up!
We’re a group of volunteers and opening a new scheme in our community. Your web site provided us with valuable information to work on. You’ve done an impressive job and our whole community will be grateful to you.