New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom / per user import path #125
Comments
It would make sense to add corresponding functionality in the GUI, to accommodate users not using OpenSCAD from the cmd-line. |
…ve precedence over the hardcoded library paths. First step of issue #125
TODO: |
+1 The path according MacOS standard filesystem layout would be ~/Library/Application Support/OpenSCAD/libraries Thanks for picking up this issue. Handling custom libraries is quite a pain on Mac, when upgrading OpenSCAD.app. |
I was thinking ~/Library/Application Support as well, but Apple discourages users to edit files there, and on 10.7+, the ~/Library folder is actually hidden. |
Added: ..in this commit: 4948c24 |
A standard location for Linux and Windows would be cool. Ideas/patches are welcome :) |
Remaining tasks:
Unless there are better suggestions, I'll look at what Arduino does and do the same for 1. and 2. |
My only idea here is to consider adding a 'standard library' location that is within the users $HOME directory. (in addition to any system-wide thing which many Linux/BSD distros will probably try to override anyway). Many people (students) do not have root access and do not understand how to set environment variables (leading to the massive confusion one usually sees in any beginner trying to use Javac and CLASSPATH for example). Something like $HOME/OpenSCAD/libraries or something> Just an idea. |
( I guess $HOME/OpenSCAD/libraries would maybe be better, as there is apparently no standard '$HOME/Documents' on Windows/Linux ) |
..and I'm not sure Windows even have a concept of $HOME. Every time I use Windows, I'm confused about where files end up (I admittedly don't use Windows more than once every few months though). |
on linux and other free unices, the paths should follow the fdo basedir spec. for openscad library includes, that means for inclusion of a relative file
this also catches the current default paths /usr/share/openscad/libraries or /usr/local/share/openscad/libraries. if other paths can be configured at compile time, they should be appended to $searchpaths. (ie the default paths should stay there to conform to basedir spec). |
Specs are good, but in this case I ask myself if any software actually supports ~/.local/share/ as a place to put user files, and if users actually find that useful (or find that folder at all). If all library handling was done through the GUI and the users wouldn't need to browse the file system, it would be a different story.. ..or perhaps I've been using a Mac for too long and unlearnt that dot-files are supposed to be user-editable ;) |
i currently have over fifty directories in there (savegames, nautilus' right-click scripts, gajim plugins, ...). users have to be pointed to the location where they should install their libraries anyway, unless they use OPENSCADPATH, and i'd consider it bad style to require well-known non-dotfiles in a user's home directory. for easy access, the openscad options could offer a "open library directory" button in the preferences (or one for every searched path). |
I like the "open library directory" function |
I support @chrysn's motion about using XDG config dirs like |
For Windows, I suggest |
Done:
Missing:
|
Created separate issue #373 for XDG compliance. closing this. |
it would be useful for users to set their own import path using an environment variable OPENSCADPATH in the same spirit as python's PYTHONPATH or a shell's PATH. this would allow them to use their own libraries without either having to specify absolute paths or needing write permissions on /usr/share/.
if there is consensus about where per-user libraries would go (~/.config/openscad/libraries?), that path could be included in the search path, but having an OPENSCADPATH would be nice nevertheless.
(copied from #123 as it was a different issue and closed without addressing this)
The text was updated successfully, but these errors were encountered: