(SOLVED) How to change default location of user standard folders e.g Documents

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
farrina
Level 1
Level 1
Posts: 21
Joined: Thu Jul 20, 2017 11:32 am

(SOLVED) How to change default location of user standard folders e.g Documents

Post by farrina »

I'm not particulary experienced with Linux so I hope I shall be forgiven for posting what is probably a rather basic question.

In a nutshell I want to change the locations for the various shortcuts shown under My Computer within Nemo 4.06 running on Linux Mint Cinammon 19.1 (4.0.10)
NemoDefault_002.png
NemoDefault_002.png (14.73 KiB) Viewed 3651 times
Currently these shortcuts appear to point to directories under /home/**myusername** so for a user name of john

eg

/home/john/Documents
/home/john/Downloads
/home/john/Videos

etc ...

I have created a new folder called SynologyDrive which is located thus

/home/john/SynologyDrive

and within this new folder additional separate directories eg

/home/john/SynologyDrive/Documents
/home/john/SynologyDrive/Dowloads
/home/john/SynologyDrive/Pictures
/home/john/SynologyDrive/Videos

What I would like to happen is to change the path for the shortcuts shown under My Computer to point to these respective new locations.

Reading around I believe that I need to amend a file in Home/.config/user-dirs.dirs

Using Documents as an example it currently shows

XDG_DOCUMENTS_DIR="$HOME/Documents"

I have tried changing this to

XDG_DOCUMENTS_DIR="$HOME/SynologyDrive/Documents

or

XDG_DOCUMENTS_DIR="/home/john/SynologyDrive/Documents"

but neither is working.

Can anyone assist and point out where I am going wrong ?
Last edited by farrina on Mon May 06, 2019 12:15 pm, edited 2 times in total.
User avatar
xenopeek
Level 25
Level 25
Posts: 25109
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to change default location of user standard folders e.g Documents

Post by xenopeek »

Yeah, that's a gotcha :shock: One might expect Nemo to adhere to the XDG specification but it doesn't appear to do so.

Those links in the sidebar are actually preset bookmarks, with configured paths. You can edit them. Open Nemo's Bookmarks menu and select to Edit Bookmarks. There you can change the path for the sidebar links.

Programs that do adhere to the XDG specification should work correctly with the modification to the user-dirs.dir file you did. Kudos on finding your way to that file, you no longer have to say you're not very experienced at Linux :) Just like the rest of us at times, you've found yourself this time delving too deep for a solution.
Image
rene
Level 16
Level 16
Posts: 6693
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to change default location of user standard folders e.g Documents

Post by rene »

Mmm. Yes, but what I would do (and in fact do) is just have the standard directories by symlinks to the actual ones. I.e., I for example have:

Code: Select all

rene@t5500:~$ ls -l Music
lrwxrwxrwx 1 rene rene 11 Apr 15 04:53 Music -> /data/Music
in my case due to having home on an smaller SSD, and a larger HDD mounted on /data. In your case it would be e.g.

Code: Select all

ln -s /home/john/SynologyDrive/Documents /home/john/Documents
and alike (delete /home/john/Documents first). The idea is that this foregoes any issue with a program not adhering to XDG such as already for example in the case of Nemo's bookmarks.
farrina
Level 1
Level 1
Posts: 21
Joined: Thu Jul 20, 2017 11:32 am

Re: How to change default location of user standard folders e.g Documents

Post by farrina »

Thank you both for your helpful suggestions - I still feel like a complete "noob" :-)

I have changed the bookmark path within Nemo on my video file

/home/john/Video

so that it now points directly to a new location

/home/john/SynologyDrive/Video

Selecting the bookmarked link opens (as expected) the Video directory within my SynolgyDrive folder

However ...

If I (say) play a random video file (using VLC) and record a portion of it, previously by default this would have been automatically saved in

/home/john/Video folder

and this continues to be the case ie its not stored under /home/john/SynologyDrive/Video

By editing Home/.config/user-dirs.dirs

from

XDG_VIDEOS_DIR="$HOME/Videos"

XDG_VIDEOS_DIR="$HOME/SynologyDrive/Videos"

This resolves the issue with VLC now storing recorded Video under $HOME/SynologyDrive/Videos rather than $HOME/Videos

So I seem to have achieved my objective, however I am still somewhat concerned as to Rene's comment

"The idea is that this foregoes any issue with a program not adhering to XDG such as already for example in the case of Nemo's bookmarks"

Following Rene's suggestion of reverting to the standard Nemo Bookmark setup and creating a symbolic link, this means that when I select the video bookmark within Nemo it opens the usual /home/john/Video folder and there within is a link (or shortcut in Windows terminology) which if selected then opens

/home/john/SynolgyDrive/Video folder

So its a two step process rather than one.

Additionally the reason for wishing to change the paths is that the contents of the /home/john/SynologyDrive folder is automatically uploaded to my NAS thereby duplicating its contents in case of local (single) disk failure.

Following Rene's advice means I would need to manually move any files created in the default locations e.g. (/home/john/Video to /home/john/SynologyDrive/Video) which is quite a faff.

From a user convenience point of view altering the bookmarks as per Xenopeek's suggestion and the Home/.config/user-dirs.dirs achieves exactly what I want. I wonder how big a risk I am taking by changing the default locations ? (I know probably an impossible question for you!)

I suppose it is mitigated somewhat as the original folders still exist on the local disk so any program that ignores the amended XDG file will just dump it in the original respective default folder.

I feel very ignorant ....
rene
Level 16
Level 16
Posts: 6693
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to change default location of user standard folders e.g Documents

Post by rene »

farrina wrote:
Mon May 06, 2019 11:34 am
Following Rene's suggestion of reverting to the standard Nemo Bookmark setup and creating a symbolic link, this means that when I select the video bookmark within Nemo it opens the usual /home/john/Video folder and there within is a link (or shortcut in Windows terminology) which if selected then opens /home/john/SynolgyDrive/Video folder. So its a two step process rather than one.
No, that means something went wrong. Shortly after replying I edited my reply to add "(delete /home/john/Documents first)" because if you do not before running that ln -s command indeed you'd find an issue as described. However, when you DO, ~/Videos and ~/SynologyDrive/Videos end up the very same; just two paths to the very same on-disk location.

Assuming that your ~/Videos folder --- note, "~/" means "your home directory" --- is in fact empty and can be deleted:

Code: Select all

$ rm -r ~/Videos
$ ln -s ~/SynologyDrive/Videos ~/Videos
At that point ls -l ~/Videos show it to BE a symlink to ~/SynologyDrive/Videos, and anything accessing ~/Videos would access latter as well without need for any further tweakage.

N.B.: I note "Video" rather then "Videos" in your quote; standard English XDG dir is with the "s".
farrina
Level 1
Level 1
Posts: 21
Joined: Thu Jul 20, 2017 11:32 am

SOLVED Re: How to change default location of user standard folders e.g Documents

Post by farrina »

Ah yes that has sorted it exactly as advertised :-)
I note "Video" rather then "Videos" in your quote; standard English XDG dir is with the "s".
Yes that would be me typing from memory - good job I don't code !

I think my experience of Linux so far is that it is very powerful, but to achieve what would take a matter of seconds in Windows takes considerably longer.

Still on the plus side Bill is no longer monitoring my every move with his invasive telemetry.

Thanks for all your help - much appreciated !
rene
Level 16
Level 16
Posts: 6693
Joined: Sun Mar 27, 2016 6:58 pm

Re: SOLVED Re: How to change default location of user standard folders e.g Documents

Post by rene »

farrina wrote:
Mon May 06, 2019 12:12 pm
I think my experience of Linux so far is that it is very powerful, but to achieve what would take a matter of seconds in Windows takes considerably longer.
Well, for what it's worth, I can assure you that for me it's quite the other way around :)
farrina
Level 1
Level 1
Posts: 21
Joined: Thu Jul 20, 2017 11:32 am

Re: (SOLVED) How to change default location of user standard folders e.g Documents

Post by farrina »

Well hopefully as my experience builds I might speed up a bit ... :-)
rene
Level 16
Level 16
Posts: 6693
Joined: Sun Mar 27, 2016 6:58 pm

Re: (SOLVED) How to change default location of user standard folders e.g Documents

Post by rene »

Again for what it's worth and as far as welcome in the first place --- but I believe you may be the type --- I'd have the general advise to not go out of your way to find graphical solutions for every or even lots of things; to embrace the terminal as soon as possible. On Windows the GUI is much more "the system" than on Linux where any given GUI is to begin with just one of a host of possible ones, each one supplying native tools of varying usability and completeness.

On Mint alone there's Cinnamon, MATE and Xfce (and until recently KDE) and although I'd find Mint to be one the Linux distributions where it's least true that a GUI has simply been bolted on to an underlying console-based operating system, the differences in for example the context of questions on this forum do already sometimes turn out confusing even for more experienced users with some oversight; for newbies it can be hell to in e.g. Google searches constantly run into differences between distributions, version thereof, editions thereof.

Mentioned underlying console-based operating system is much more uniform and, better still, much better documented through e.g. local manual pages: try f.e. man ls from a terminal prompt. There's certainly still distribution differences also there but mostly as to how things are setup by a specific distribution, not so much how you'd administer it. Moreover, Mint is an Ubuntu-derivative which in turn is a Debian-derivative which makes it part of a very large universe of Ubuntu and/or Debian derived distributions in which even said setup is the same to mostly the same.

Linux systems are much less polished than Windows, are to fairly high degree a bit of a hodgepodge still. It's up to now never been and still is not the case that "the terminal" is not still the main entry point to understanding things -- at the very least as far as I'm concerned.
farrina
Level 1
Level 1
Posts: 21
Joined: Thu Jul 20, 2017 11:32 am

Re: (SOLVED) How to change default location of user standard folders e.g Documents

Post by farrina »

Thank you for your kind comments and further observations.

Having been a long standing Windows user (not in at the beginning but i did start with Windows 95) I am finding Linux (Mint) quite refreshing. Whilst, as you say, its not as polished as Windows, i have over the last 5 years or so become increasing concerned as to my privacy and this was one of the main reasons I abandoned Windows.

There are a couple of aspects I particularly like about Linux - one is that it only install things that you explicitly approve (yes Microsoft I am looking at you with your Candy Crush game in Windows 10 Professional), the other is its flexibility. If you have the knowledge it’s endlessly configurable.

Its like starting school over again, but its fun ...

Thanks again for taking the time to respond to my question so comprehensively.
User avatar
NChewie
Level 4
Level 4
Posts: 226
Joined: Wed Oct 15, 2014 8:46 am
Location: Ireland

Re: (SOLVED) How to change default location of user standard folders e.g Documents

Post by NChewie »

its not as polished as Windows
Well... in some respects maybe, e.g. third party hardware vendors tend to provide drivers to support the interface to the latest version of windows and there is more software written for windows as it is the default OS on most PCs.
But in others aspects linux surpasses windows.
e.g. last week WindowsUpdate automatically disabled my wifi on my work Windows10 laptop; and WindowsUpdate failed on the Windows7 partition of my home laptop - while all of my linuxmint updates worked flawlessly. Even when WindowsUpdate works, it ties up my PC for ages with "Do not unplug or turn off".

IMHO fast reliable updates are a key plus for linux in general and mint in particular.

That is one of the reasons that I use linux by choice (although I am forced into using windows at work as it is a 'secure device' :roll: provided by my employer (using MS windows and Outlook on an intel base (!))
Toshiba Satellite Pro C650-191 LM19.2 Cinnamon
Post Reply

Return to “Newbie Questions”