Caja is a great file manager, and like most Linux file managers, you can use the Back/Previous and Forward/Next buttons at the beginning of the toolbar to navigate between folders you’ve been in during that session. And if you ever want to clear the history of visited folders, it’s as easy as opening the Go menu and clicking Clear History. But if you’re a power user of the history feature, and are constantly clearing it to unclutter the locations visited, then you may have thought a toolbar button for that would be handy.
But one unfortunate limitation 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 “Clear History” Button
As you can see by the screenshot above, it creates a comparatively large button in the toolbar, because it displays the full Clear History label (and that can’t be changed), but if you’ve got plenty of toolbar space, and really want that button, then let’s proceed. 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. For this example, I’m adding the code after the Search button, but you can add it wherever you please.
<toolitem name="Clear History" action="Clear History"/>
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!
For info on how to Add or Remove Separators, Reorder Existing Buttons, and Remove Unwanted Buttons, check out this guide!
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