One of the most common complaints about Caja I’ve seen – especially from new users migrating from Windows – is the lack of Copy, Cut and Paste buttons. While I personally prefer keyboard shortcuts for basic editing functions, I understand that many of you might like to have buttons for Copy, Cut, and Paste to save you reaching for the keyboard (EDIT: after trying to copy/cut then paste a bunch of files and folders while eating a sandwich in my left hand, I too see the use for these buttons!).
Caja is a great file-manager, but one limitation that annoys many is that you can’t customise the toolbar in the Preferences dialogue (though it’s worth noting that Nautilus doesn’t even have a toolbar any more, and while Nemo lets you customise its toolbar, you are severely limited in what buttons are available). However, you can in fact add new buttons, and remove unwanted ones, and I’ll show you how.
It comes down to specifying toolitems in the config file caja-navigation-window-ui.xml, and wherever you paste the code will determine where the buttons end up. For example, if you add the code for your custom buttons after the entry for the Home button, that’s where they will end up; if you add them after all the default buttons, they will end up on the right end of the toolbar. So you can add your buttons where you want, reorder them as you please, and even get rid of unwanted ones.
Adding Copy, Cut & Paste Buttons
First off, open the file for editing with the following command:
pluma admin:///usr/share/caja/ui/caja-navigation-window-ui.xml
The second half of the file deals with the toolbar, so locate the button you want to put your custom ones after. Hit Enter at the end of that line, and paste the code into the empty paragraph beneath it, making sure to preserve the indent. For this example, I’m adding the code after the Computer button, but you can add it wherever you please.
<toolitem name="Copy" action="Copy"/>
<toolitem name="Cut" action="Cut"/>
<toolitem name="Paste" action="Paste"/>
Note that if you pasted all 3 lines at once, you will need to hit the spacebar a few times before the Cut and Paste lines, so their indents line up with the others. Once you’ve added your custom buttons, save the file, then reload Caja (either by manually closing all windows, or running caja -q in the terminal, then opening Caja again). Your new toolbar buttons will be there and ready to use!
Separators, Reordering Buttons & Removing Unwanted Buttons
And if you want to add a separator anywhere, just add <separator/> in between the lines of the buttons (or if you want the reverse, to remove a separator, then delete that line).
If you want to reorder your buttons to your liking, it’s as easy as moving around the lines of code. And, lastly, if there are default toolbar buttons you can do without, simply delete the lines for them. Or, if you’d prefer to comment them out, note that being an .xml file, you can’t use a hash (#) – that results in the entire toolbar disappearing. The correct syntax for XML files is to start the line off with a less-than symbol followed by an exclamation point and two dashes (<!--
), then end the line with two dashes followed by a greater-than symbol (-->
). In the following example, I’m commenting out the “Stop” button (which is useless in my opinion, and just taking up valuable space), and note that since there is already a greater-than symbol (>) at the end, all you need to do is insert two dashes (--
) before it:
<!-- <toolitem name="Stop" action="Stop"/-->
You will see in the file that the line has been successfully commented out:
Once you’ve finished your toolbar tweaks, you will of course need to reload Caja for the changes to take effect.
See also: Full List of Available Caja Toolbar Buttons
☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻
The tutorial above is TOTALLY FREE, and I hope you found it useful! But if this information really made your day, because it rescued you from hours of headache, or allowed you to accomplish something you thought was impossible, then please consider making a donation via PayPal, to buy me a donut, beer, or pizza for my time and effort! Many thanks in advance!
Leave a comment