为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

By default, Ubuntu creates a folder called Desktop in your home directory that gets displayed on your desktop. What if you want to use something else, like your Dropbox folder? Here we look at how to use any folder for your desktop.

默认情况下,Ubuntu在主目录中创建一个名为Desktop的文件夹,该文件夹会显示在桌面上。 如果您想使用其他东西(例如Dropbox文件夹)怎么办? 在这里,我们研究如何在桌面上使用任何文件夹。

Not only can you change your desktop folder, you can change the location of any other folder Ubuntu creates for you in your home folder, like Documents or Music – and this works in any Linux distribution using the Gnome desktop manager.

您不仅可以更改桌面文件夹,还可以更改Ubuntu在您的主文件夹中为您创建的任何其他文件夹的位置,例如“文档”或“音乐”,并且可以在使用Gnome桌面管理器的任何Linux发行版中使用。

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

In this example, we’re going to change desktop to show our Dropbox folder. Open your home folder in a File Browser by clicking on Places > Home Folder.

在此示例中,我们将更改桌面以显示我们的Dropbox文件夹。 通过单击位置>主文件夹在文件浏览器中打开主文件夹。

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

In the Home Folder, open the .config folder. By default, .config is hidden, so you may have to show hidden folders (temporarily) by clicking on View > Show Hidden Files.

在主文件夹中,打开.config文件夹。 默认情况下, .config是隐藏的,因此您可能必须通过单击“视图”>“显示隐藏的文件”来显示隐藏的文件夹(临时)。

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

Then open the .config folder by double-clicking on it.

然后双击打开.config文件夹。

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

Now open the user-dirs.dirs file…

现在打开user-dirs.dirs文件…

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

If double-clicking on it does not open it in a text editor, right-click on it and choose Open with Other Application… and find a text editor like Gedit.

如果双击无法在文本编辑器中将其打开 ,请右键单击它,然后选择“ 使用其他应用程序打开...”,然后找到诸如Gedit之类的文本编辑器。

Change the entry associated with XDG_DESKTOP_DIR to the folder you want to be shown as your desktop. In our case, this is $HOME/Dropbox.

将与XDG_DESKTOP_DIR关联的条目更改为要显示为桌面的文件夹。 在我们的例子中,这是$ HOME / Dropbox

Note: The “~” shortcut for the home directory won’t work in this file (use $HOME for that), but an absolute path (i.e. a path starting with “/”) will work.

注意:主目录的“〜”快捷方式在此文件中不起作用(为此使用$ HOME),但是绝对路径(即以“ /”开头的路径)将起作用。

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

Feel free to change the locations of the other folders as well.

也可以随意更改其他文件夹的位置。

Save and close user-dirs.dirs. At this point you can either log off and then log back on to get your desktop back, or open a terminal window Applications > Accessories > Terminal and enter:

保存并关闭user-dirs.dirs 。 此时,您可以注销然后重新登录以恢复桌面,或者打开终端窗口“应用程序”>“附件”>“终端”,然后输入:

killall nautilus

杀死鹦鹉螺

Nautilus (the file manager in Gnome) will restart itself and display your newly chosen folder as the desktop!

Nautilus(Gnome中的文件管理器)将自行重启,并将您新选择的文件夹显示为桌面!

为您的Ubuntu桌面使用任何文件夹(甚至是Dropbox文件夹)

This is a cool trick to use any folder for your Ubuntu desktop. What did you use as your desktop folder? Let us know in the comments!

在您的Ubuntu桌面上使用任何文件夹都是一个很酷的技巧。 您使用什么作为桌面文件夹? 让我们在评论中知道!

翻译自: https://www.howtogeek.com/howto/17752/use-any-folder-for-your-ubuntu-desktop-even-a-dropbox-folder/