-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
XDG basedir standard on X11 Godot platforms #197
XDG basedir standard on X11 Godot platforms #197
Conversation
I do believe i have successfully got the Palette working nyaa <3 Including the copy-on-write of system palettes in /usr/share/pixelorama/Palette(s), into the user XDG data directory when changed, and an override system :) |
Why not use the Project Settings Use Custom User Dir property? It should handle everything for you. The Custom User Dir Name can be customized on a per-platform basis using feature tags (so you could have |
The specific reason for me doing this is so the system handles $XDG_DATA_HOME and $XDG_DATA_DIRS correctly. To my understanding, the Godot setting does not handle them (especially the second one, since it cannot possibly know how to correctly do prioritised/overridable file loading) nya. The first one, again to my understanding, hardcodes it rather than checking the environment variable (though it might not). But one of the key things with this PR is that it means you can store read-only system files in /usr/share or wherever the system configured $XDG_DATA_DIRS, which is important for most packages nyaa. |
I appreciate the effort, but I still think this is way too much code for something that's best left to the engine 🙁 Do you intend to package Pixelorama for a Linux distribution? Note that there's already a Flatpak available. |
It just doesn't fit with the linux standard now, and as far as i know the engine doesn't handle it properly according to XDG basedir standards () so we just have to do it ourselves ;-; |
(and yes, i am making a PKGBUILD :p) |
…ks as-if the randomised brushes are separated out from all the other brushes in directories nyaaaa ^.^
Both the Palette and Brushes should now functionally work with xdg basedir standard, with appropriate overriding behaviour ^.^ |
I've exported it on Windows so far and it works okay. Only problem is that it doesn't work when I run it inside Godot. It should create a pixelorama folder with the Brushes and Palettes folders inside of it, but it doesn't. It does on export though, which is the important part I guess. The problem in the editor can be fixed if we create a "pixelorama" folder in the repo, and move "Brushes" and "Palettes" there. Could you do that? I think if you do it should be ready to get merged. |
Will do! |
It might be a good idea for me to make it so that when the data directories are empty it adds "res://" to it so it can load from internal data. I don't know if Brushes and Palettes actually get stored in the executable though. nya |
Brushes and Palettes don't get stored in the executable, unfortunately. Their existence on the repo is purely to be there for the people that clone it. When I'm exporting the binaries, I'm copying the brushes and palette files manually. |
Cool ^.^ |
Tested it on Ubuntu too. Works as expected. It seems that we can no longer include the Brushes and Palettes into the .zip itself like we used to, since it's loading/saving them elsewhere, so loading them from "res://" is an one-way road now. Probably copying them from res:// to the actual directories, if the directories don't exist. Which is all right, it'll save me some time from putting the files manually myself on every binary I export. I'll merge it now, and we can figure out loading them from internal data some other time. Thank you! |
Now that Godot 3.4 has new OS data directory getter methods (godotengine/godot#49732), I wonder if the XDGDataPaths scripts can be simplified, or if it's needed anymore. |
I think the XDG script is no longer needed in 3.4 and later. The built-in methods should provide the same functionality. |
Make Palettes/Brushes get loaded/saved in appropriate locations as specified by the XDG basedir standard, for easier usage of standard linux/bsd packaging methods and for better per-user usability.