As with any Linux file-manager, if you want to find out the properties of selected files and folders, you just need to hit Alt+Enter, or right-click and choose Properties . But if you’re selecting items with your mouse, it makes sense to have a toolbar button for this task, so you can quickly and easily click that, rather than have to initiate it via a key-combo. That way you can easily get information about the folder you’re in (if nothing is selected) or the selected file(s) and/or folder(s).
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 button ends up. For example, if you add the code for your custom button after the entry for the Home button, that’s where it will end up; if you add it after all the default buttons, it 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 Properties Button to Caja’s Toolbar
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. I’ve added mine near the far end of the toolbar, but you can add it wherever you please.
<toolitem name="Properties" action="Properties"/>
Once you’ve added your custom button, 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 button 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