目录 - 如何设置Nautilus文件管理器的默认打开文件夹?

分享于 

4分钟阅读

ubuntu

  繁體

问题

如何配置Nautilus以打开文档文件夹而不而是home文件夹?

/usr/share/applications/nautilus.desktop 文件,将%U替换为所需默认目录的路径,

我编辑了每个要读取的文件,如下所示:


Exec=nautilus --new-window /home/judy/Documents




答案1

unity-dash不再是 /usr/share/applications/nautilus.desktop 而而是 /usr/share/applications/org.gnome.Nautilus.desktop

问题而是一个条目DBusActivatable=true,它使系统通过dbus运行nautilus, /usr/share/dbus-1/services/org.gnome.Nautilus.service

对我来说,一个简单的解决方案而是隐藏gnome/dbus启动程序图标,使旧图标再次可见,将条目NotShowIn=Unity;添加到/org.gnome.Nautilus.desktop,并在nautilus.desktop中将它注释掉,在那里你可以调整Exec=行与所需的目录。


(file: org.gnome.Nautilus.desktop)



[Desktop Entry]


NotShowIn=Unity; # <--------------------------- add this line !


Name=files


Comment=Access and organize files


Keywords=folder;manager;explore;disk;filesystem;


Exec=nautilus --new-window %U


Icon=system-file-manager


Terminal=false


Type=Application


DBusActivatable=true


StartupNotify=true


Categories=GNOME;GTK;Utility;Core;FileManager;


MimeType=inode/directory;application/x-gnome-saved-search;


X-GNOME-Bugzilla-Bugzilla=GNOME


X-GNOME-Bugzilla-Product=nautilus


X-GNOME-Bugzilla-Component=general


X-GNOME-Bugzilla-Version=3.14.2


X-GNOME-UsesNotifications=true


Actions=Window;


X-Unity-IconBackgroundColor=#af4853


X-Ubuntu-Gettext-Domain=nautilus



#OnlyShowIn=Unity; # <---------------- comment out this line !



[Desktop Action Window]


Name=Open a New Window


Exec=nautilus --new-window


#OnlyShowIn=Unity; # <---------------- comment out this line !




(file nautilus.desktop)



[Desktop Entry]


#NotShowIn=Unity; # <---------------- comment out this line !


Name=files


Comment=Access and organize files


Keywords=folder;manager;explore;disk;filesystem;


Exec=nautilus --new-window /{DESIRED_DIRECTORY} # <- adjust !


Icon=system-file-manager


Terminal=false


Type=Application


StartupNotify=true


Categories=GNOME;GTK;Utility;Core;FileManager;


X-GNOME-Bugzilla-Bugzilla=GNOME


X-GNOME-Bugzilla-Product=nautilus


X-GNOME-Bugzilla-Component=general


X-GNOME-Bugzilla-Version=3.14.2


X-GNOME-UsesNotifications=true


Actions=Window;


X-Unity-IconBackgroundColor=#af4853


X-Ubuntu-Gettext-Domain=nautilus



[Desktop Action Window]


Name=Open a New Window


Exec=nautilus --new-window




答案2

有一个更简单的方法:

  • 在桌面上创建一个空文件。

  • 使用文本编辑器打开它,例如gedit。

  • 编写以下行:

    
    [Desktop Entry]
    
    
    Name="Open Nautilus in custom folder"
    
    
    Exec="nautilus /path/to/custom/folder"
    
    
    Type=Application
    
    
    
    
  • 将它保存为nautilus_custom.desktop打开终端,并运行:

    
    chmod +x $HOME/Desktop/nautilus_custom.desktop
    
    
    
    


    文件  MAN  SET  DIR  DEF  FOLD