Caja is a great file-manager, and one feature that many use, and that Nautilus discarded aeons ago, is the Split View option to open another pane in the same window. Personally, I’ve never been a huge fan of that, preferring to drag files, etc, to another tab, or entirely new window. So for those of us who prefer this approach, it makes sense to have toolbar buttons for Open New Tab and Open New Window.
But one limitation of Caja is that you can’t customise the toolbar in the Preferences dialogue. 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.
Add “Open New Tab” and “Open New Window” 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 below into the empty paragraph beneath it, making sure to preserve the indent. Personally, I put these near the end of the toolbar, but you can put them wherever you please, and you can of course reverse the order of those two buttons, or just add one of them.
<toolitem name="New Tab" action="New Tab"/>
<toolitem name="New Window" action="New Window"/>
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 Reply