How to restore my Trash icon, and Documents folder?

Hello Ubuntu on Discourse.

This is my first post here … I’m very experienced with computers, but new to Ubuntu (… a Windows escapee :slightly_smiling_face:)

I am using Ubuntu 22.04.5 LTS

I’ve been using my new Ubuntu laptop for a couple of months now, and generally it’s all going nicely. But recently I noticed my Documents folder had dissapeared. I must have accidentally deleted it, so I went to look in Trash (or Wastebasket?) but my Trash icon had dissapeared too.

Using bash I found the trash folder at
~/.local/share/Trash
but no Documents folder there.

No big deal I used ‘mkdir Documents’ and restored the contents from backups.
However ‘Documents’ no longer appears in my Files window as a primary folder.

I also searched on how to restore my Trash icon, and found suggestions using Ubuntu Tweaks but I could not get that to work.

I have 3 questions:

  1. How to give my Documents folder it’s original status as a ‘primary’ folder?
  2. Does it matter if I don’t (I can still access it just fine)
  3. How to restore the Trash icon?

Thanks in advance

1 Like

Take a look to the command xdg-user-dirs-update with the option –set (using man xdg-user-dirs-update).

Or you can just manually edit the file /home/your_profile/.config/user-dirs.dirs
For instance I have this contents into that file (folders are in spanish):

XDG_DESKTOP_DIR="$HOME/Escritorio"
XDG_DOWNLOAD_DIR="$HOME/Descargas"
XDG_TEMPLATES_DIR="$HOME/Plantillas"
XDG_PUBLICSHARE_DIR="$HOME/Público"
XDG_DOCUMENTS_DIR="$HOME/Documentos"
XDG_MUSIC_DIR="$HOME/Música"
XDG_PICTURES_DIR="$HOME/Imágenes"
XDG_VIDEOS_DIR="$HOME/Vídeos"

About the trash icon, where do you want to restore it? Desktop or Files?

Also, if you just want to see the Documents icon in the Files bookmarks just navigate to your Documents folder (see previous post to know where is it located) and drag it to the Files bookmarks zone with the mouse… 100% windows style. But my Files version is the one shipped in Ubuntu 24.10 so this may not work for an old Ubuntu version like yours.

Gracias senor !
For some reason the following command kept failing, saying DOCUMENTS was an invalid parameter:
xdg-user-dirs-update DOCUMENTS ~/Documents

So I edited the file directly and that works fine.

Restoring this doesn’t seem to be very important, all it does is add it to left pane of Files window AFAIK?

Restoring this doesn’t seem to be very important, all it does is add it to left pane of Files window AFAIK?

Well, It’s importance depends. There are more applications that rely in this folder scheme like Files, so it’s better to maintain it in a working state. For instance, if an application expects $XDG_DOCUMENTS_DIR as default working folder and it’s not assigned it may cause problems.

Additionally this scheme makes easy the translation of these common folders to other languages than English, even at run-time, because apps should use the $XDG value instead of an hardcoded folder name so it will work independently of the local name of the folders.

Ah OK, thanks. Makes more sense now …