that's why I say we ignore this parameter in 0.20 and use a new one, if the parameter is something different than the default maybe it could copy the value of the parameter. If 0.20 will keep using the same parameter, can we get a fix for 0.19.3 so it doesn't overwrite the parameter after I fixed it in 0.20? (I'm using a symlink so both versions are using the same config file, once 0.20 is released I would like to just delete the .FreeCAD folder and not have to change the parameter again)
XDG Base Directory Specification
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: XDG Base Directory Specification
Re: XDG Base Directory Specification
Temporary solution would be a warning and a button to move things.
But if you set:
As I do to manage different version running on same computer what will happen?
only HOMe/.config/FreeCAD is moved to the desired directory?
so If I have more versions, Addon and other things wiil be searched for both (or many versions) in same places?
maybe make also environment variables to manage this thing, (FREECAD_USER_MOD) and maybe (FREECAD_USER_CACHE)?
EDIT:
These lines in the https://github.com/FreeCAD/FreeCAD/comm ... 0c2bc3e27b
means that there is already such a mechanism, but how could be used?
I could derive that:
FREECAD_USER_HOME >> QString configHome = std::get<0>(stdPaths);
so what are the environment variable names for dataHome and cacheHome?
END EDIT
so a user could use a complete separate "set of directories" to run different versions of FreeCAD, I use ApppImages and doing this I could use stable and dev and sometimes ls3 to check different behaviours.
Hassle of setting three directories instead of one is not very big, as it is a "corner user case", so whatever choice is done to preserve the isolation of different running versions will be a mere problem of knowing what to do.
Losing the ability is the worst case, and I think this has to be avoided, as there were maybe some cases on which an enterprise want to preserve a centralized version of /Mod dir, think of a case when this enterprise is developing his own workbench and want to have same copy running for all the istance of FreeCAD on the entire enterprise (maybe with 20 or more workstation) but have the /Mod/ dir symlinked to a "network shared directory"
Regards
Carlo D.
Regards
Carlo D.
But if you set:
Code: Select all
export FREECAD_USER_HOME="somedir"
only HOMe/.config/FreeCAD is moved to the desired directory?
mean that /Mod dir where AddOn manager store files are not a subdirectory of FREECAD_USER_HOME?data files go to $HOME/.local/share/FreeCAD
so If I have more versions, Addon and other things wiil be searched for both (or many versions) in same places?
maybe make also environment variables to manage this thing, (FREECAD_USER_MOD) and maybe (FREECAD_USER_CACHE)?
EDIT:
These lines in the https://github.com/FreeCAD/FreeCAD/comm ... 0c2bc3e27b
Code: Select all
QString configHome = std::get<0>(stdPaths);
QString dataHome = std::get<1>(stdPaths);
QString cacheHome = std::get<2>(stdPaths);
means that there is already such a mechanism, but how could be used?
I could derive that:
FREECAD_USER_HOME >> QString configHome = std::get<0>(stdPaths);
so what are the environment variable names for dataHome and cacheHome?
END EDIT
so a user could use a complete separate "set of directories" to run different versions of FreeCAD, I use ApppImages and doing this I could use stable and dev and sometimes ls3 to check different behaviours.
Hassle of setting three directories instead of one is not very big, as it is a "corner user case", so whatever choice is done to preserve the isolation of different running versions will be a mere problem of knowing what to do.
Losing the ability is the worst case, and I think this has to be avoided, as there were maybe some cases on which an enterprise want to preserve a centralized version of /Mod dir, think of a case when this enterprise is developing his own workbench and want to have same copy running for all the istance of FreeCAD on the entire enterprise (maybe with 20 or more workstation) but have the /Mod/ dir symlinked to a "network shared directory"
Regards
Carlo D.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: XDG Base Directory Specification
you could set up a user account in linux for each version
Re: XDG Base Directory Specification
But actually all is working perfectly as setting:thomas-neemann wrote: ↑Wed Nov 17, 2021 4:22 pm ....
you could set up a user account in linux for each version
FREECAD_USER_HOME will separate all the configuration files for different versions, as Mod and Macro are put into FREECAD_USER_HOME so there is no mix between say a stable and a ls3 version.
see as example:
this is the result of setting: FREECAD_USER_HOME=/home/common/FreeCAD/config-ls3
a .FreeCAD directory is created and also a temp dir is created
This is the content of .FreeCAD directory when setting FREECAD_USER_HOME=/home/common/FreeCAD/config-dev
You could note that Macro Mod and AddOnManager are created here plus some other things, like user.cfg and system-cfg this will result in a separation of the Additional WB loaded but also settings like preferences and user configurations.
Regards
Carlo D.
Last edited by onekk on Sat Jul 22, 2023 1:17 pm, edited 1 time in total.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: XDG Base Directory Specification
I expect setting XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME should give a similar result. See https://wiki.archlinux.org/title/XDG_Ba ... irectories
Are the FreeCAD specific environment variables not working anymore? This wiki page should be updated once this stuff is settled: https://wiki.freecadweb.org/Start_up_an ... _variables
Are the FreeCAD specific environment variables not working anymore? This wiki page should be updated once this stuff is settled: https://wiki.freecadweb.org/Start_up_an ... _variables
what happens if I set the XDG variables (for example to $HOME/.FreeCAD) mentioned above and FREECAD_USER_HOME (for example to $HOME/freecad020) at the same time? Also, is any of them meaningful on windows?wmayer wrote:
Re: XDG Base Directory Specification
Ok good for my use, only to know how to do.
but
setting XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME will change entire system behaviour.
So having dedicated FreeCAD environment variable like now, it will be a more desirable behaviour.
https://wiki.freecadweb.org/Start_up_an ... _variables
This is only windows centric, at least on the part about "USB portable...." as Linux is using AppImages, maybe some addition for Linux users will be a good job.
Regards
Carlo D.
but
setting XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME will change entire system behaviour.
So having dedicated FreeCAD environment variable like now, it will be a more desirable behaviour.
https://wiki.freecadweb.org/Start_up_an ... _variables
This is only windows centric, at least on the part about "USB portable...." as Linux is using AppImages, maybe some addition for Linux users will be a good job.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: XDG Base Directory Specification
I was under the impression that you were using a script to launch FreeCAD? If so, the variables are set only within the script and don't affect the rest of the system unless you launch other programs within FreeCADonekk wrote: ↑Thu Nov 18, 2021 9:07 am Ok good for my use, only to know how to do.
but
setting XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME will change entire system behaviour.
So having dedicated FreeCAD environment variable like now, it will be a more desirable behaviour.
https://wiki.freecadweb.org/Start_up_an ... _variables
This is only windows centric, at least on the part about "USB portable...." as Linux is using AppImages, maybe some addition for Linux users will be a good job.
Regards
Carlo D.
Re: XDG Base Directory Specification
Yes, but as I'm used to do scripting with FreeCAD, and something inside Scripts there are Qt things, if I set "locally" XDG_... also Qt things are affected to the XDG path changes.
Better to have a way to override only FreeCAD directories so FREECAD_USER or Whatever they will be IMHO are better suited to make the job.
If not maybe if you are settings Qt apperance to match say GTK things, as sometimes is done in mixed (GTK and Qt) enviroment you have to copy and mantain different instances of same file.
The main use I do (and I suspect other people do) when changing FRECAD_ environment variable is to "isolate" different copies of FreeCAD running on same machine, maybe for testing purpouses.
Now this "isolation" is working, as expected without changing XDG_.....
I use a different location of .FreeCAD only because I have two different Linux distribution running on my computer and don't want to fiddle with many settings.
Same thing I suspect could happens if you use a "net mounted" directory to uniform maybe /Mod dir across different Workstations in a small business environment, in such case using XDG_.... will maybe more difficult to manage as on different could run different version or same distribution or even different distributions.
But this is only a suspect and not an evidence, as we usually are hoping that FreeCAD will spread his use in some "serious" environment, this is an eventuality to have in mind.
All the above consideration are done IMHO and by a "non professional user".
Regards
Carlo D.
Better to have a way to override only FreeCAD directories so FREECAD_USER or Whatever they will be IMHO are better suited to make the job.
If not maybe if you are settings Qt apperance to match say GTK things, as sometimes is done in mixed (GTK and Qt) enviroment you have to copy and mantain different instances of same file.
The main use I do (and I suspect other people do) when changing FRECAD_ environment variable is to "isolate" different copies of FreeCAD running on same machine, maybe for testing purpouses.
Now this "isolation" is working, as expected without changing XDG_.....
I use a different location of .FreeCAD only because I have two different Linux distribution running on my computer and don't want to fiddle with many settings.
Same thing I suspect could happens if you use a "net mounted" directory to uniform maybe /Mod dir across different Workstations in a small business environment, in such case using XDG_.... will maybe more difficult to manage as on different could run different version or same distribution or even different distributions.
But this is only a suspect and not an evidence, as we usually are hoping that FreeCAD will spread his use in some "serious" environment, this is an eventuality to have in mind.
All the above consideration are done IMHO and by a "non professional user".
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: XDG Base Directory Specification
You are right, this is a valid point.wmayer wrote: ↑Wed Nov 17, 2021 7:12 am Also, if it were configurable the user could map it to /tmp and this IMO can be quite harmful because when the user clicks the "Check now..." button (or the automatic check at start) and the size exceeds the defined limit a dialog comes up where the user can clean the directory. However, in /tmp many other programs put their files there and I don't know what will happen if they got deleted.
Yes, there are extra settings for FEM in the preferences. But it is not about big FEM files only, it is about the dumping the home disk. Anyway, since it is editable in the parameters, it is OK.
Greetings
user1234
Re: XDG Base Directory Specification
The automatic copying of the user.cfg is only planned to be there for short time only and I will remove it soon. I added it to reduce the number of cries if the new version suddenly starts as virgin FreeCAD.adrianinsaval wrote:IMO this would be best to avoid such unwanted behavior, it's sometimes hard enough to get people to understand how to clear their config, explaining that they might have to do it twice because the old configs got copied over again will be a PITA. I suggest providing macros to migrate config, macros and addon so they are copied at the users discretion. Optional symlink creation to keep configs in sync in case it's desired would be neat too.
For the long-term migration support a Python script might be useful but migrating the user.cfg this way will be more difficult. This is because you have a running FreeCAD instance when running the Python script and when you only copy the file it will be overridden as soon as the FreeCAD instance is closed. So, what would be additionally needed is to immediately load the user.cfg after copying it but this can cause further problems because of the observers of parameter groups. So for now people have to do the copying manually.
They still work because they are needed for people who want to run a portable version.Are the FreeCAD specific environment variables not working anymore?
FREECAD_USER_HOME will override the XDG path. Theoretically you can define the XDG paths to adjust the FreeCAD paths but you must be aware that depending on how you do it you affect other applications that implement the XDG specs.what happens if I set the XDG variables (for example to $HOME/.FreeCAD) mentioned above and FREECAD_USER_HOME (for example to $HOME/freecad020) at the same time?
I don't think so.Also, is any of them meaningful on windows?