Move Location Of ~/.leo File For Future Installs?

48 views
Skip to first unread message

Thomas Passin

unread,
Mar 25, 2023, 9:36:05 PM3/25/23
to leo-editor
@paolomi has requested that Leo's user's home directory be moved - on Linux - from the location it has always had to a new one.  The current location is ~/.leo.  @paolomi thinks it should not be in ~/ so as to reduce clutter in the user's home directory.  Existing installations would not be changed. The issue for the request is XDG Base Directory on Linux #3213.

If we followed the Linux XDG guidelines closely, configuration-related data would go into ~/.config, and other contents of .leo would go into various other folders, one of which would be ~/.local/share.  Windows locations would continue to have the directory where it has always been: %USERPROFILE%\.leo.

I think that splitting up the contents of the current .leo folder into several others would add complication and confusion.  OTOH, I agree with the desire to reduce clutter in one's home directory.  So I am agreeable to changing the future location of the user's leo directory to ~/.local/share/leo, and so is @poalomi.  @edward has not expressed an opinion yet.  Once again, all current installations would be unchanged.

Before this change gets made I'd like to see what other Linux users think we should do if anything.  On Macs, I do not anticipate making a change.  For scripters, the variable under consideration is g.app.homeLeoDir.  Please chime in with your thoughts and suggestions.

Félix

unread,
Mar 25, 2023, 10:29:19 PM3/25/23
to leo-editor
For various reasons, I personally would be against this change. 

Looking at my home folder in Linux (Doesn't feel cluttered to me by 'dot files' probably because most Linux flavor UI's hide files beginning with a dot, so I have to turn 'show invisible' on) 

Screenshot from 2023-03-25 22-13-08.png

I may be wrong, (or right but for the wrong reasons) but Leo seems to me to be important enough to have a (dot/hidden config) folder in my home. Seems like a big standard for all those big software packages already in there.

Although i'm not an expert on linux/home folder standards and that 'XDG' thing, I would wait for way more / better reasons to make this change. If at all. 

Félix

(Also, is Macs os not some linux variant?) :)



Thomas Passin

unread,
Mar 25, 2023, 11:14:04 PM3/25/23
to leo-editor
Thanks for your  thoughts, Felix.  XDG is one of those not-quite-standards that is supposed to promote interoperability and "sane" locations for various kinds of system files and others. I'm no expert but it seems to me that some major distros follow it less strictly for user locations than others. I said I would be agreeable to moving it, but I'm equally agreeable to keeping it as it is now.

Some people think than XDG dismembers applications into various directories for reasons that made sense when we had small drives but not so much now that mass storage is so cheap and abundant.  I don't have enough experience to have an informed opinion.  I hope we will hear from others too.

Edward K. Ream

unread,
Mar 26, 2023, 6:25:34 AM3/26/23
to leo-e...@googlegroups.com
On Sat, Mar 25, 2023 at 8:36 PM Thomas Passin <tbp1...@gmail.com> wrote:
@paolomi has requested that Leo's user's home directory be moved - on Linux - from the location it has always had to a new one.  The current location is ~/.leo.  @paolomi thinks it should not be in ~/ so as to reduce clutter in the user's home directory.  Existing installations would not be changed. The issue for the request is XDG Base Directory on Linux #3213.

I don't like this proposal:

- It's not needed.
- It might create problems for existing users.
- The home directory is a natural place for this data.
- The home directory often contains subdirectories starting with `.<app-name>'.
  Both Linux and Windows hide such directories by default.

Edward

Thomas Passin

unread,
Mar 26, 2023, 6:56:13 AM3/26/23
to leo-editor
On Sunday, March 26, 2023 at 6:25:34 AM UTC-4 Edward K. Ream wrote:
On Sat, Mar 25, 2023 at 8:36 PM Thomas Passin <tbp1...@gmail.com> wrote:
@paolomi has requested that Leo's user's home directory be moved - on Linux - from the location it has always had to a new one.  The current location is ~/.leo.  @paolomi thinks it should not be in ~/ so as to reduce clutter in the user's home directory.  Existing installations would not be changed. The issue for the request is XDG Base Directory on Linux #3213.

I don't like this proposal:

- It's not needed.
- It might create problems for existing users.
It would not affect any existing installation, only fresh ones that have no existing ~/.leo directory. 
- The home directory is a natural place for this data.
The XDG spec doesn't want the home directory to be used like this.  But it's a fact that a lot of other programs do anyway.  The original requester wants to declutter his home directory, but if a dozen other programs put their own directories there (as @Felix's screen shot demonstrates), moving .leo out won't accomplish much decluttering .  From the XDG Spec:

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

- The home directory often contains subdirectories starting with `.<app-name>'.
Both Linux and Windows hide such directories by default.
I always tell the file manager to show the hidden directories, though, and I imagine many other Linux users do too. 

At this time I prefer that we leave the location unchanged, but let's wait a little to let anyone else speak up.

Alexander Laertes

unread,
Mar 26, 2023, 10:21:21 AM3/26/23
to leo-e...@googlegroups.com
> @paolomi thinks it should not be in ~/ so as to reduce clutter in the
> user's home directory.


On 26.3.2023 07:25, Edward K. Ream wrote:
> - The home directory is a natural place for this data.
> - The home directory often contains subdirectories starting with
> `.<app-name>'.
> Both Linux and Windows hide such directories by default.


The initial request seems to conflate 'reducing $HOME clutter' with
'adopting the XDG directory specification' in regards to where data,
config, state files (and so on) are stored.

There are places in the code where purpose-specific files and folders
are directly derived from g.app.homeLeoDir, so redesigning leo (and
plugins) to redistribute files across different locations will be
burdensome.

1) To prevent cluttering $HOME, would it not be enough to specify the
location of homeLeoDir to somewhere else?

2) Is there currently no way to customize the location of homeLeoDir? If
not, perhaps it would be convenient to have the ability to customize it
at startup, e.g. via command line parameter or environment variable.

For reference, here is a listing with software which does not comply
with the XDG Directory Specification, but allow customizing the file
system paths they read/write in some way:
https://wiki.archlinux.org/title/XDG_Base_Directory#Partial

Thomas Passin

unread,
Mar 26, 2023, 10:35:16 AM3/26/23
to leo-editor
On Sunday, March 26, 2023 at 10:21:21 AM UTC-4 al...@laerios.com wrote:
> @paolomi thinks it should not be in ~/ so as to reduce clutter in the
> user's home directory.


On 26.3.2023 07:25, Edward K. Ream wrote:
> - The home directory is a natural place for this data.
> - The home directory often contains subdirectories starting with
> `.<app-name>'.
> Both Linux and Windows hide such directories by default.


The initial request seems to conflate 'reducing $HOME clutter' with
'adopting the XDG directory specification' in regards to where data,
config, state files (and so on) are stored.

I brought up the XDG directories because the original request by @paolomi specifically mentioned them.  He suggested using the XDG-specified location of config files.  Since the leo directory contains more kinds of files than config files, I suggested that the closest XDG-blessed location would be ~/.local/share.  I don't think that's a very good fit to the XDG categories, but it seems the closest of any one.
 
There are places in the code where purpose-specific files and folders
are directly derived from g.app.homeLeoDir, so redesigning leo (and
plugins) to redistribute files across different locations will be
burdensome.

1) To prevent cluttering $HOME, would it not be enough to specify the
location of homeLeoDir to somewhere else?

Yes, that's basically what the issue is about.
 
2) Is there currently no way to customize the location of homeLeoDir? If
not, perhaps it would be convenient to have the ability to customize it
at startup, e.g. via command line parameter or environment variable.

I don't think there is at present.  I don't see much value in letting the location be user-customized, at least for Leo, because the user would have to keep track of the location, and there would need to be a default anyway in case the user didn't want to (or didn't know where to choose).  The more things that just work all by themselves, the better.  That has always been the case with the .leo directory.
Reply all
Reply to author
Forward
0 new messages