Friday, May 23, 2014

GNOME Nautilus toolbar

The events of life are always interposing with our plans.
My goals have been delayed and added since my original plans.
Never mind, I'll persevere and keep on working on them.

By the way, I've been busy with another University degree.
This month I've also attended to the 30 years meeting of my Air Force class.
It was great; memories, regrets, new hopes, but still the same ideals and values.

OK, all that isn't Solaris.
Let's focus :-)

Let me register how to somewhat enhance GNOME Nautilus toolbar.
This is just a collection of a few Internet and personal findings.

GNOME Nautilus is delivered with a reasonable configuration in Solaris 11.
Here's how it typically looks like:


Actually there's not so much to tweak and extend.
Even so, I'd like to customize the toolbar to something that better fit my needs.
Here's the final result of my attempt:


I hope the change will be well apparent.
There's a new separator and 2 buttons were added and 1 moved:
  
  • The ZFS snapshots button has been moved.
    IMO the ZFS snapshot button was misplaced, so I've "corrected" it.
      
  • A button for deleting files (move to Trash).
    I'm still not sure of the advantage of the move to Trash button.
    The Del key is always available anyway (at least on English keyboards).
       
  • A create folder (not a ZFS file system) button.
    I think it frequently saves a click which seems good to me.
    But there may be cases where a ZFS file system would be better.
    (see GNOME Nautilus scripts)
       
Here's how it's done:

# cd /usr/share/nautilus/ui
# cp -p nautilus-navigation-window-ui{,-original}.xml
# vim nautilus-navigation-window-ui.xml

BEFORE

# tail -19 nautilus-navigation-window-ui-original.xml  
<toolbar name="Toolbar">
    <toolitem name="Back" action="Back"/>
    <toolitem name="Forward" action="Forward"/>
    <toolitem name="Up" action="Up"/>
    <toolitem name="Stop" action="Stop"/>
    <toolitem name="Reload" action="Reload"/>
    <toolitem name="Restore" action="Restore"/>
    <separator/>
    <toolitem name="Home" action="Home"/>
    <toolitem name="Computer" action="Go to Computer"/>
    <separator/>
    <toolitem name="Zoom" action="Zoom"/>
    <toolitem name="ViewAs" action="ViewAs"/>
    <toolitem name="Search" action="Search"/>
    <placeholder name="Extra Buttons Placeholder">
        <placeholder name="Extension Actions"/>
    </placeholder>
</toolbar>
</ui>


AFTER

# tail -24 nautilus-navigation-window-ui.xml
<toolbar name="Toolbar">
    <toolitem name="Back" action="Back"/>
    <toolitem name="Forward" action="Forward"/>
    <toolitem name="Up" action="Up"/>
    <toolitem name="Stop" action="Stop"/>
    <toolitem name="Reload" action="Reload"/>
    <separator/>
    <toolitem name="Home" action="Home"/>
    <toolitem name="Computer" action="Go to Computer"/>
    <separator/>
    <toolitem name="Zoom" action="Zoom"/>
    <toolitem name="ViewAs" action="ViewAs"/>
    <toolitem name="Search" action="Search"/>

    <!-- Begin customizations -->
    <separator/>

    <toolitem name="Restore" action="Restore"/>
    <toolitem name="Trash" action="Trash"/>
   
<toolitem name="New Folder" action="New Folder"/> 
    <!-- End customizations -->
    <placeholder name="Extra Buttons Placeholder">
        <placeholder name="Extension Actions"/>
    </placeholder>

</toolbar>
</ui>


Finally, back to the regular user GNOME session, kill all Nautilus processes (in order to refresh for the new settings):

$ pkill nautilus
   
Alternatively, you could have attempted to issue the more graceful:

$ nautilus -q