Nautilus 3.4 allows you to set a default view mode. It also remembers your custom view settings for specific folders.
What I would love to be able do is to define a view mode for all directories and subdirectories in a specific directory tree. Going through each and every folder to change the view mode manually would take too long.
Is there any way I can do this? Maybe through a Nautilus script that modifies gvfs-metadata?
Overview
To find the metadata for a folder you need to use the command
gvfs-info foldername
for example
gvfs-info /home/homefolder/Desktop
In the list that returns you will see the attribute
metadata::nautilus-default-view
which describes the default view.You can change this attribute using the command
gvfs-set_attribute foldername attribute newvalue
for example:
Script
Now I have to admit my bash scripting skills aren't the best, but here you go - my script below will allow you to reset all the views below the folder-name given.
Syntax:
for example this will reset to compact view all folders below
/home/homefolder/Desktop
use
folderreset -h
for the syntax.Feel free to tinker and amend.
GUI wrapper
Here is a simple GUI wrapper script that could be used to set the view mode right from the Nautilus scripts context menu:
The script depends on the zenity fork
yad
which can be installed from this PPA. Make sure to pointFOLDERRESET=
to the location of thefolderreset
script on your system.