Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
Is there a keyboard shortcut to toggle Tree view / Places View?

I want to know if there's a hotkey in Nautilus to toggle between Tree View and Places. I googled around but I haven't found any solution... If there isn't such a hotkey, is it possible to suggest Nautilus' developers to implement this in future versions? I really like the "Places" feature, but in some occasions Tree View is more suitable to my needs.

share|improve this question

marked as duplicate by jokerdino, nitstorm, jrg Mar 1 '12 at 16:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 2 down vote accepted

You could use a script to toggle between the commands. Here's a python script.

Copy the following into a file

#!/usr/bin/env python

from subprocess import Popen, PIPE

setting = Popen(['gsettings', 'get', 'org.gnome.nautilus.window-state', 'side-pane-view'], stdout=PIPE).communicate()[0].rstrip()

if setting == "'places'":
    Popen(['gsettings', 'set', 'org.gnome.nautilus.window-state', 'side-pane-view', '"tree"'])
elif setting == "'tree'":
    Popen(['gsettings', 'set', 'org.gnome.nautilus.window-state', 'side-pane-view', '"places"'])

Save it as ~/.pane-toggle.py. Make it executable

chmod +x ~/.pane-toggle.py

Open the Keyboard settings and go to the Shortcuts tab. On the left, choose custom shortcuts, and make a new shortcut with the '+' button. Name it whatever you want. For the command, use

/home/username/.pane-toggle.py.

Now just set the shortcut to what you want (press enter while it's highlighted).

Of course you can name the file whatever you want and put it wherever you want, just be consistent.

share|improve this answer
    
Thank you very much for the script... it worked perfectly. –  Rafael Lima Nov 17 '11 at 13:21
    
@RafaelLima Glad to help. If this answers your question, you can mark it as correct and the question will not be "unanswered". –  Kris Harper Nov 17 '11 at 13:34

Try this if instead of places you prefer a tree view of your folders placed on the left panel, use this command

gsettings set org.gnome.nautilus.window-state side-pane-view "tree"

To revert it back

gsettings set org.gnome.nautilus.window-state side-pane-view "places"

There is no shortcut that I know of but you can create a small scrip that does that for you and bind it to a kb shortcut, if you are interested drop a comment, I'll make one for you.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.