8

I deleted the music folder in Home, but on the left is still the shortcut. I cannot find a way to delete that shortcut? How do I delete that?

2

2 Answers 2

11

To remove the "Music" folder in the left bar of Files (nautilus), set your MUSIC directory to be your home folder:

xdg-user-dirs-update --set MUSIC ~

This sets your Music folder to be the same as Home. That will cause Nautilus not to include it any more.

Other apps relying on XDG special folders may also be affected. For example, Gnome Music, if you use that, will now consider your Home folder to be the default storage for music. Unfortunately, however, there is no way to remove Music from Files without wider side effects.

Instead, you could edit ~/.config/user-dirs.dirs yourself if you prefer. Change XDG_MUSIC_DIR="$HOME/Music/" into XDG_MUSIC_DIR="$HOME/".

It is not a good approach to remove the folder by deleting or commenting out the line for the folder in ~/.config/user-dirs.dirs. If you do that, the missing folder would be added again on your next login, based on the default folders defined in /etc/xdg/user-dirs.defaults. As a result, to make the change persistent, you would be required to edit the system file /etc/xdg/user-dirs.defaults which 1) requires you to be administrator and 2) affect any other users of the system (and they may not want that).

9

There are two files that you need to edit:

  • ~/.config/user-dirs.dirs
  • /etc/xdg/user-dirs.defaults

Edit the first in a text editor of your choice and comment out the shortcut(s) you don't want. You can do this by putting a # at the start of the line.

Then edit the second file in a text editor of your choice via sudo, commenting out the shortcut(s) you don't want.

After both files are edited, log out and back in again to apply the change.

6
  • Is there a need to edit the system wide /etc/xdg/user-dirs.defaults?
    – vanadium
    May 8, 2021 at 13:00
  • 1
    Experience has taught me that if the default is not edited as well, then the local may be rewritten during a login. Editing both ensures that any replacement of the local copy does not revert the change.
    – matigo
    May 8, 2021 at 13:19
  • 1
    In that case it would perhaps be better practice to make the local file read only.
    – vanadium
    May 8, 2021 at 16:30
  • 1
    If you remove PICTURES, the Print Screen button saving a pic there won't work anymore (and play an error sound).
    – lolesque
    Jun 20, 2022 at 12:50
  • @lolesque An option to removing is to change the directory names. You can hide them somewhere or incorporate into your vision of home directory. This way, all applications will still work, but the clutter will be gone. Jul 4, 2022 at 20:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .