Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 872  / 2 Years ago, tue, april 19, 2022, 3:37:32

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.


More From » nautilus

 Answers
3

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.


[#42019] Wednesday, April 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arbaour

Total Points: 346
Total Questions: 115
Total Answers: 105

Location: Oman
Member since Wed, Apr 12, 2023
1 Year ago
;